Commit 435b8476 authored by Dominik Charousset's avatar Dominik Charousset

Add ostream operator for config_value

parent df948253
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <iosfwd>
#include <iterator> #include <iterator>
#include <map> #include <map>
#include <string> #include <string>
...@@ -452,6 +453,9 @@ inline bool operator!=(const config_value& x, const config_value& y) { ...@@ -452,6 +453,9 @@ inline bool operator!=(const config_value& x, const config_value& y) {
/// @relates config_value /// @relates config_value
std::string to_string(const config_value& x); std::string to_string(const config_value& x);
/// @relates config_value
std::ostream& operator<<(std::ostream& out, const config_value& x);
template <class... Ts> template <class... Ts>
config_value make_config_value_list(Ts&&... xs) { config_value make_config_value_list(Ts&&... xs) {
std::vector<config_value> lst{config_value{std::forward<Ts>(xs)}...}; std::vector<config_value> lst{config_value{std::forward<Ts>(xs)}...};
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "caf/config_value.hpp" #include "caf/config_value.hpp"
#include <ostream>
#include "caf/detail/ini_consumer.hpp" #include "caf/detail/ini_consumer.hpp"
#include "caf/detail/parser/read_ini.hpp" #include "caf/detail/parser/read_ini.hpp"
#include "caf/detail/type_traits.hpp" #include "caf/detail/type_traits.hpp"
...@@ -136,5 +138,8 @@ std::string to_string(const config_value& x) { ...@@ -136,5 +138,8 @@ std::string to_string(const config_value& x) {
return deep_to_string(x.get_data()); return deep_to_string(x.get_data());
} }
} // namespace caf std::ostream& operator<<(std::ostream& out, const config_value& x) {
return out << to_string(x);
}
} // namespace caf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment