need some metaprogramming ideas

I want to develop a way of checking if I can implement a trivial string converter through lexical_cast. If that converter doesn't exist then the developer is required to make one and a different converter is made that throws an exception if called (may not be the best way but for now that's what I'm working with). To be lexical castable T must be OutputStreamable, InputStreamable, CopyConstructable, and DefaultConstructable. I think I can implement checks for streamable through the sizeof trick...haven't thought of the exact way yet but I think it should work. I can't think of how to test for CopyConstructable or DefaultConstructable though. Any ideas?

I think I can implement checks for streamable through the sizeof trick...haven't thought of the exact way yet but I think it should work.
I can't think of how to test for CopyConstructable or DefaultConstructable though. Any ideas?
Unfortunately I don't believe those two are testable for in C++03, in C++0x of course one can use concepts for that purpose. John.
participants (2)
-
John Maddock
-
Noah Roberts