Subject: [Boost-users] compile-time string literal manipulation?
From: Stiles Watson (watson_at_[hidden])
Date: 2010-10-27 17:46:05


I'm a new to metaprogramming so please bare with the stupid questions:

I have a requirement to convert string literals to a specified format at
compile-time. In otherwords, given a literal like "3A689", I need to
verify the value and, if not valid, generate a correct value such that:

//pseudocode
const char ch[] = verify<"3A689">::valid_value;

would result in something like:

const char ch[] = "03A689X";

Can I use Boost to write a template to do this?

I know that is extremely vague, but does anyone have any thoughts?

Thanks.