[string_algo] detail::pred_notF<> implicit constructor

The other day I wrote a line that looked something like: foo.erase( std::remove_if(foo.begin(), foo.end(), some_condition ? !boost::is_any_of("blah") : boost::is_any_of("blah")), foo.end()); This compiled fine, but behaved unexpectedly at runtime. It seems that the compiler decides to instantiate the remove_if template with the predicate type as the negator class, which has an implicit constructor. So even when some_condition is false, it still ended up negating the predicate. The class involved is algorithm::detail::pred_notF<>. Is there any reason for the constructor to be implicit? (Some of the other constructors in classification.hpp are also implicit.) Thanks, -- Jordan DeLong jordan.delong@gmail.com
participants (1)
-
Jordan DeLong