majintao0131 / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

YAML::Node::operator[] failed for (char *) #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
YAML::Node doc;
...
doc[gettext("Test")];
...

failed:
In file included from /usr/include/yaml-cpp/node.h:131:0,
                 from /usr/include/yaml-cpp/yaml.h:10,
                 from ETMaterial.cpp:2:
/usr/include/yaml-cpp/nodereadimpl.h: In function 'bool 
YAML::ConvertScalar(const YAML::Node&, T&) [with T = char*]':
/usr/include/yaml-cpp/nodeimpl.h:24:3:   instantiated from 'void 
YAML::operator>>(const YAML::Node&, T&) [with T = char*, YAML::Node = 
YAML::Node]'
/usr/include/yaml-cpp/nodereadimpl.h:45:5:   instantiated from 'static bool 
YAML::read_impl<false>::read(const YAML::Node&, T&) [with T = char*]'
/usr/include/yaml-cpp/nodereadimpl.h:71:119:   instantiated from 'bool 
YAML::Node::Read(T&) const [with T = char*]'
/usr/include/yaml-cpp/nodeimpl.h:47:4:   instantiated from 'const YAML::Node* 
YAML::Node::FindValueForKey(const T&) const [with T = char*]'
/usr/include/yaml-cpp/nodeimpl.h:37:31:   instantiated from 'const YAML::Node* 
YAML::Node::FindValue(const T&) const [with T = char*]'
/usr/include/yaml-cpp/nodeimpl.h:58:40:   instantiated from 'const YAML::Node& 
YAML::Node::GetValue(const T&) const [with T = char*]'
/usr/include/yaml-cpp/nodeimpl.h:65:22:   instantiated from 'const YAML::Node& 
YAML::Node::operator[](const T&) const [with T = char*]'
ETMaterial.cpp:27:22:   instantiated from here
/usr/include/yaml-cpp/nodereadimpl.h:82:31: error: no matching function for 
call to 'Convert(std::string&, char*&)'
/usr/include/yaml-cpp/nodereadimpl.h:82:31: note: candidates are:
/usr/include/yaml-cpp/conversion.h:16:14: note: bool YAML::Convert(const 
string&, std::string&)
/usr/include/yaml-cpp/conversion.h:16:14: note:   no known conversion for 
argument 2 from 'char*' to 'std::string& {aka std::basic_string<char>&}'
/usr/include/yaml-cpp/conversion.h:21:20: note: bool YAML::Convert(const 
string&, bool&)
/usr/include/yaml-cpp/conversion.h:21:20: note:   no known conversion for 
argument 2 from 'char*' to 'bool&'
/usr/include/yaml-cpp/conversion.h:22:20: note: bool YAML::Convert(const 
string&, YAML::_Null&)
/usr/include/yaml-cpp/conversion.h:22:20: note:   no known conversion for 
argument 2 from 'char*' to 'YAML::_Null&'
/usr/include/yaml-cpp/conversion.h:25:105: note: template<class T> bool 
YAML::Convert(const string&, T&, typename YAML::enable_if<YAML::is_numeric<T> 
>::type*)

==============
But doc[(const char *)gettext("Test")] works

Original issue reported on code.google.com by pashev.i...@gmail.com on 1 Sep 2011 at 10:23

GoogleCodeExporter commented 9 years ago
Fixed, rf40459e10197.

Thanks!

Original comment by jbe...@gmail.com on 6 Sep 2011 at 5:33