
From: "Jeff Flinn" <TriumphSprint2000@hotmail.com>
I just found this snippet of code in one of my projects:
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string/classification.hpp>
bool NameValid( const std::string& aName ) { using namespace boost::algorithm;
return all( aName, !is_any_of(" -") );; }
looks familiar eh? I totally forgot about this. I haven't looked in Pavol Droba's string algorithm library to see if there are additional facilities that cover other cases. The 'string' in Pavol's library defines string as a general concept and not as std::string.
That expression would be easier to read with the junctions idea: none_of(aName) == any_of(" -"); (Assuming all of the above syntax can be made to work!) Don't you agree? -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;