Re: [Cppcms-users] error in json.h
Brought to you by:
artyom-beilis
|
From: Marcel H. <ke...@co...> - 2013-05-22 19:58:29
|
I know that to make that work I have to write "ap.second", but
netherless there is no method set_value with two arguments, or am I
seeing something terrible wrong?
On 22.05.2013 20:42, Artyom Beilis wrote:
>
> The point is that ap has a type pair<const string,value>. object is a map of string to json value
>
> that is why it is not working
> ------------------------------
> On Wed, May 22, 2013 1:03 PM IDT Marcel Hellwig wrote:
>
>> Hi Artyom,
>>
>> in your cppcms/json.h (which is really nice) is an error.
>>
>> If you try this
>>
>> for(auto& ap : v.object())
>> createLogger(ap);
>> where v is a json::value and create logger is this
>>
>> void createLogger(const cppcms::json::value &obj);
>> you will receive this error message
>> In file included from
>> /home/marcel/projects/logre/src/configloader.cpp:21:0:
>> /usr/local/include/cppcms/json.h: In instantiation of ‘static void
>> cppcms::json::traits<std::pair<_T1, _T2> >::set(cppcms::json::value&,
>> const std::pair<_T1, _T2>&) [with T1 = const cppcms::string_key; T2 =
>> cppcms::json::value]’:
>> /usr/local/include/cppcms/json.h:245:26: required from ‘void
>> cppcms::json::value::set_value(const T&) [with T = std::pair<const
>> cppcms::string_key, cppcms::json::value>]’
>> /usr/local/include/cppcms/json.h:314:4: required from
>> ‘cppcms::json::value::value(const T&) [with T = std::pair<const
>> cppcms::string_key, cppcms::json::value>]’
>> /home/marcel/projects/logre/src/configloader.cpp:51:24: required from here
>> /usr/local/include/cppcms/json.h:601:4: error: no matching function
>> for call to ‘cppcms::json::value::set_value(const char [6], const
>> cppcms::string_key&)’
>> v.set_value("first",in.first);
> 0> ^
>> /usr/local/include/cppcms/json.h:601:4: note: candidate is:
>> In file included from
>> /home/marcel/projects/logre/src/configloader.cpp:21:0:
>> /usr/local/include/cppcms/json.h:243:8: note: template<class T> void
>> cppcms::json::value::set_value(const T&)
>> void set_value(T const &v)
>> ^
>> /usr/local/include/cppcms/json.h:243:8: note: template argument
>> deduction/substitution failed:
>> In file included from
>> /home/marcel/projects/logre/src/configloader.cpp:21:0:
>> /usr/local/include/cppcms/json.h:601:4: note: candidate expects 1
>> argument, 2 provided
>> v.set_value("first",in.first);
>> ^
>> /usr/local/include/cppcms/json.h:602:4: error: no matching function
>> for call to ‘cppcms::json::value::set_value(const char [7], const
>> cppcms::json::value&)’
>> v.set_value("second",in.second);
>> ^
>> /usr/local/include/cppcms/json.h:602:4: note: candidate is:
>> In file included from
>> /home/marcel/projects/logre/src/configloader.cpp:21:0:
>> /usr/local/include/cppcms/json.h:243:8: note: template<class T> void
>> cppcms::json::value::set_value(const T&)
>> void set_value(T const &v)
>> ^
>> /usr/local/include/cppcms/json.h:243:8: note: template argument
>> deduction/substitution failed:
>> In file included from
>> /home/marcel/projects/logre/src/configloader.cpp:21:0:
>> /usr/local/include/cppcms/json.h:602:4: note: candidate expects 1
>> argument, 2 provided
>> v.set_value("second",in.second);
>> and yeah, there is no set_value function which takes two arguments. I
>> think you missed something ;)
>> Error occurred in the latest-svn-version. Hope you will fix it or say
>> what I am missing.
>>
>> Regards
>> Marcel Hellwig
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
|