Vcsn  2.8
Be Rational
to-string.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream> // std::cout
4 #include <sstream>
5 #include <string>
6 
7 namespace vcsn
8 {
10  template <typename ValueSet, typename Value = typename ValueSet::value_t,
11  typename... Args>
12  auto
13  to_string(const ValueSet& vs, const Value& v, Args&&... args)
14  -> std::string
15  {
16  std::ostringstream o;
17  vs.print(v, o, std::forward<Args>(args)...);
18  return o.str();
19  }
20 
22  template <typename ValueSet>
23  auto
24  to_string(const ValueSet& vs)
25  -> decltype(vs.print_set(std::cout), std::string{})
26  {
27  std::ostringstream o;
28  vs.print_set(o);
29  return o.str();
30  }
31 }
Definition: a-star.hh:8
return v
Definition: multiply.hh:362
std::string to_string(direction d)
Conversion to string.
Definition: direction.cc:7