id summary reporter owner description type status milestone component version severity resolution keywords cc 4397 specialization for lexical_cas for identical Target and Source types alexey.kutumov@… Antony Polukhin "std::string s1 = ""str""; std::string result = boost::lexical_cast(s1); In this case it is possible to use specialization of lexical_cast which just returns input arg. I created simple example with specialization of lexical_cast: {{{ #include #include #include #include template struct helper { /// Default action is to use lexical_cast static Target get(const Source & src) { return boost::lexical_cast(src); } }; template struct helper { /// Use this if Target and Source identical static Target get(const Source & src) { return src; } }; template Target my_lexical_cast(const Source & res) { /// Use boost::is_same for checking identity of Target and Source return helper::value>::get(res); } int main(int argc, char * argv[]) { std::string b1 = ""10""; std::string b2 = my_lexical_cast(b1); int b3 = my_lexical_cast(b1); std::cout << ""b1: "" << b1 << std::endl; std::cout << ""b2: "" << b2 << std::endl; std::cout << ""b3: "" << b3 << std::endl; return 0; } }}} This code checked in msvc 9.0, mingw32-g++ 4.4.0 " Feature Requests closed Boost 1.44.0 lexical_cast Boost 1.44.0 Optimization fixed lexical_cast specialization alexey.kutumov@…