Boost program_options trouble

K

Krivenok Dmitry

I use boost program_options library in my project.
But I have one trouble and can't solve it :(

I writing simple wrapper class and use generic selector:
///////////////////////////////////////////////////////////////////
// General options selector
template <class T>
void CmdLine::GetOption(const std::string& Name, T& var)
{
if (VariablesMap_.count(Name)) var = VariablesMap_[Name].as<T>();
}
////////////////////////////////////////////////////////////////////
But this method doesn't compile!!!
Errors are :
Compiling OBJ/Cmdline.oIn file included from
CmdLineParse/Cmdline.hpp:46,
from CmdLineParse/Cmdline.cpp:7:
CmdLineParse/Cmdline.tcc: In member function `void
CmdLine::GetOption(const
std::string&, T&)':
CmdLineParse/Cmdline.tcc:7: syntax error before `>' token

Where is my error?
 
M

mlimber

Krivenok said:
I use boost program_options library in my project.
But I have one trouble and can't solve it :(

I writing simple wrapper class and use generic selector:
///////////////////////////////////////////////////////////////////
// General options selector
template <class T>
void CmdLine::GetOption(const std::string& Name, T& var)
{
if (VariablesMap_.count(Name)) var = VariablesMap_[Name].as<T>();
}
////////////////////////////////////////////////////////////////////
But this method doesn't compile!!!
Errors are :
Compiling OBJ/Cmdline.oIn file included from
CmdLineParse/Cmdline.hpp:46,
from CmdLineParse/Cmdline.cpp:7:
CmdLineParse/Cmdline.tcc: In member function `void
CmdLine::GetOption(const
std::string&, T&)':
CmdLineParse/Cmdline.tcc:7: syntax error before `>' token

Where is my error?

I can't see an error. Can you paste the whole file. Perhaps the problem
is outside of this function.

Cheers! --M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top