LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
escape.hxx
Go to the documentation of this file.
1 
6 #ifndef MISC_ESCAPE_HXX
7 # define MISC_ESCAPE_HXX
8 
9 # include <misc/escape.hh>
10 # include <misc/contract.hh>
11 
12 # include <boost/lexical_cast.hpp>
13 
14 namespace misc
15 {
16 
17  template <class T>
18  escaped
19  escape(const T& obj)
20  {
21  return escaped(obj);
22  }
23 
24  inline
25  std::ostream&
26  operator<<(std::ostream& o, const escaped& rhs)
27  {
28  return rhs.print(o);
29  }
30 
31  template <class T>
32  escaped::escaped(const T& obj)
33  {
34  pobj_str_ = boost::lexical_cast<std::string>(obj);
35  }
36 
37 }
38 
39 #endif // !MISC_ESCAPE_HXX