
Ryan McConnehey wrote:
I'm trying to validate an ip address and port that is being passed in through the command line arguments. I could retrieve the string and do the validation outside program options. I thought it would be better to use the custom validate function shown in the documentation. I'm trying to retrieve the information as a boost::asio::ip::udp::endpoint. Even after creating the validate function the compiler is complaining that there is no user defined function or stream operator. I've include some code to show what I'm doing. Any help would be great.
[CommandLine class omitted]
static void validate(boost::any & v, std::vectorstd::string const& values, boost::asio::ip::udp::endpoint * target_type, int) { CommandLine::validate(v, values); }
I've only tried custom validation once, a while ago, but when I did, I put the validate function in the same namespace as the target type. It wouldn't surprise me if program options uses ADL and that's actually a requirement. So try putting validate in the boost::asio::ip::udp namespace. -- Anthony Foglia Princeton Consultants (609) 987-8787 x233