-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: no match for 'operator<<' #73
Comments
Sorry, it's my failure. I found I didn't update the corresponding section in README from v2 to 3. With the latest code, you need to pass const auto data = toml::value{{"foo", 42}, {"bar", "baz"}};
std::cout << data << std::endl; |
Thanks for the quick response. I'll try it out as soon as possible. |
I'm getting a different error now.
|
I couldn't reproduce the error in my local machine. Here is my code. #include "toml.hpp"
#include <iostream>
int main()
{
toml::basic_value<toml::preserve_comments> v(42);
v.comments().insert(v.comments().begin(), " some comments");
std::cout << v << std::endl;
return 0;
} And what I did is $ g++ test.cpp -std=c++11 -Wall -Wextra -Wpedantic
$ ./a.out
42 # some comments Could you tell me what code did you wrote? |
error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>} ' and 'const std::unordered_map<std::__cxx11::basic_string<char>, toml::basic_value<toml::discard_comments, std::unordered_map, std::vector> >') std::cout << data << std::endl;
Can you assist me with this error?I've only added in the following code
const auto data = toml::table{{"foo", 42}, {"bar", "baz"}}; std::cout << data << std::endl;
from the READMEI imported the header library via
#include "toml11/toml.hpp"
instead of installing it and importing it. Could this be the reason?The text was updated successfully, but these errors were encountered: