Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-04-06 07:29:41


Suresh T wrote:

> hello boosters,
>
> An old boost library that i was using, provided a validator function (in
> the value_sematic.hpp file) that could be used for
> creating user defined parsers and it was handy
>
> The signature was something like :
> void validator<T, char>::operator() (any& v, const
> std::vector<std::string>& xs);
>
> I had a working code that used it and when i tried to recompile my old
> code with a new boost release it did not compile.
> I then realized that the validator function is no longer there.
> Can someone please let me know if this has been substituted by something
> else (what?) or what i would have to use now in such cases.

It's still there, but in different syntactic form:

   void validate(boost::any& v,
                 const std::vector<std::string>& xs,
                 YOUR_TYPE_HERE* dummy_parameter,
   int dummy_parameter2)
   {
 // YOUR CODE HERE
   }

The change, as well as dummy parameters, were necessary to handle some
broken compilers, notably borland.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net