Your Tokenshould just contain a std::string inside it (that's a substring of the original string that was parsed). That's it. No templates involved at all. I don't see why that's a problem.
Because I want the data to be extremely-literal. - I want the Tokens to reflect their C++ values.
For example, I want a number/int token to be parsed, and reflected with C++'s built-in int type. E.g. Janky:13 = C++:Token<int>(13);
The reason I don't wanna use an std::string is because I have to parse the value later, when I could do it all at once, and not worry about it later. (This would be useful for easy-arithmetic between 2 tokens of the same type.)
Your
Token
should just contain astd::string
inside it (that's a substring of the original string that was parsed). That's it. No templates involved at all. I don't see why that's a problem.Because I want the data to be extremely-literal. - I want the
Token
s to reflect their C++ values.For example, I want a number/int token to be parsed, and reflected with C++'s built-in
int
type. E.g. Janky:13
= C++:Token<int>(13);
The reason I don't wanna use an
std::string
is because I have to parse the value later, when I could do it all at once, and not worry about it later. (This would be useful for easy-arithmetic between 2 tokens of the same type.)Have you looked at
std::any
?No.
But it looks interesting.
Thanks for pointing me in s direction.