on Wed Sep 26 2007, Jean-Christophe Roux
Hello,
Thank you for the parameter library; it is making my library much nicer to use. Two questions: 1. I am assuming there is no runtime penalty to use the BOOST_PARAMETER version of a function. Is that right?
In the performance tests we ran, with optimization and inlining on, there was zero or negative (yes, negative!) performance penalty. http://svn.boost.org/trac/boost/browser/trunk/libs/parameter/test/efficiency...
2. My code looks like that: namespace keywords { BOOST_PARAMETER_NAME(id) BOOST_PARAMETER_NAME(test) } BOOST_PARAMETER_FUNCTION ( (void),foo,keywords::tag, (optional (id, *, "") (test, (const char*), "") ) ) { ... } Here the parameters must be converted, if necessary, to const char* in order to be used later. What would be the best way to write the requirement that the type must be const char* or must be convertible to const char*?
Just use the declaration as you have written it. Inside your function the test parameter will be of type const char*, but outside it will accept anything convertible to const char*. HTH, -- Dave Abrahams Boost Consulting http://www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com