Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T, T... Chars>
- class EncryptString {
- private:
- static std::size_t const Length = sizeof...(Chars);
- T* Value;
- std::size_t Current;
- template<typename... T_args>
- void AddChar(T c, T_args... others){
- AddChar((((c ^ 0x12) ^ 0x55) + 1));
- AddChar(others...);
- }
- void AddChar(T c){
- Value[Current++] = c;
- }
- public:
- EncryptString(){
- Current = 0;
- Value = new T[Length + 1];
- AddChar(Chars...);
- }
- ~EncryptString(){
- delete[] Value;
- }
- };
- EncryptString<char, 'T','e','s','t','i','n','g'> str;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement