Euphoria
string_io.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 
5 #include "base/result.h"
6 
7 
8 namespace eu
9 {
10  template<typename T>
11  struct StringParser
12  {
13  enum { value = 0 };
14 
15  // add a template specialization for the custom type with value=1
16 
17  // static Result<T> parse(const std::string& value)
18  // static std::string to_string(const T&)
19  };
20 
21  template<typename T>
22  std::string
24  {
26  }
27 
28  template<typename T>
29  Result<T>
30  parse_for_custom_argparser(const std::string& value)
31  {
32  return StringParser<T>::parse(value);
33  }
34 }
Definition: assert.h:90
Result< T > parse_for_custom_argparser(const std::string &value)
Definition: string_io.h:30
std::string to_string(const Aabb &a)
Definition: aabb.cc:110
std::string to_string_for_custom_argparser(const T &t)
Definition: string_io.h:23