All pastes #596807 Raw Edit

Anonymous

public text v1 · immutable
#596807 ·published 2007-06-30 06:16 UTC
rendered paste body
#include <string>
#include <libconfig.h++>

int main(int argc, char **argv)
{
    libconfig::Config c;
    c.readFile("conf.conf");

    std::string s = c.lookup("lol.lol");
    libconfig::Setting &x = c.lookup("lol.lol");
    s = x;

}

also, s = (std::string)x; produces the same


libconfig.cpp: In function ‘int main(int, char**)’:
libconfig.cpp:11: error: call of overloaded ‘basic_string(libconfig::Setting&)’ is ambiguous
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../../include/c++/4.2.0/bits/basic_string.tcc:226: note: candidates are: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../../include/c++/4.2.0/bits/basic_string.tcc:183: note:                 std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]