2

Possible Duplicate:
How do I use boost::lexical_cast and std::boolalpha? i.e. boost::lexical_cast< bool >(“true”)

I am trying to cast from string to bool with the method lexical_cast as I show below:

boost::lexical_cast<bool>("false");

The problems is that it throws the exception

boost::bad_lexical_cast

I have read the documentation and I understand that boost::lexical_cast<bool>("false") is correct.

Community
  • 1
  • 1
Jjreina
  • 2,633
  • 6
  • 33
  • 54
  • 1
    "I understand that ... is correct"? The documentation doesn't say that. In fact there was [a discussion in the boost community](http://lists.boost.org/Archives/boost/2002/05/30074.php) some time ago about this issue, and they ended up accepting that there is no simple 'correct' way to design this. – Yakov Galka Jul 06 '12 at 08:10
  • Ok, thanks very much but my englesh is really bad and i dind´t understand, Sorry – Jjreina Jul 06 '12 at 08:19

0 Answers0