KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to use a string as the ID to obtain some object. At implement this in a run-time, and works well. But this makes the static type checking impossible, for obvious reasons. I've Googled for the algorithm for calculating the hash-sum of string in the compile-time: C++ compile-time string hashing with Boost.MPL . It seems to be the perfect solution to my problem, except that the sring which is necessary to the algorithm should be split into pieces by 4 characters, or character-by-character, as well, for obvious reasons. i.e., instead of the usual current record of the ID's, I'll have to write this way: hash_cstring<boost::mpl::string<'obje', 'ct.m', 'etho', 'd'>>::value This is absolutely unusable. The question is, how to pass correctly the string such as "object.method" to this algorithm? Thank you all.
Tags (comma-separated)
Save Edits
Cancel