Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T, T... Chars>
- class EncryptString {
- private:
- template <T C>
- struct EncryptChar {
- static char const Value = (((C ^ 0x12) ^ 0x55) + 1);
- };
- 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);
- AddChar(others...);
- }
- void AddChar(T c){
- Value[Current++] = c;
- }
- public:
- EncryptString(){
- Current = 0;
- Value = new T[Length + 1];
- AddChar(EncryptChar<Chars>::Value...);
- }
- ~EncryptString(){
- delete[] Value;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement