Tree2
[siwg.git] / espy / src / tree / common.h
blob7bbf9930b318560fab13584da83f4333443ef07d
1 /*------------------------------------------------------------- -*- linux-c -*- *
2 | Espy |
3 |------------------------------------------------------------------------------|
4 *------------------------------------------------------------------------------*/
6 /**
7 * \file
8 * Commonly used primitive types and inline functions.
9 * \author Andrzej Nagórko
12 #ifndef __common__
13 #define __common__
15 #include <sstream>
17 template <class T>
18 bool from_string(T& t,
19 const std::string& s)
21 std::istringstream iss(s);
22 return !(iss >> std::dec >> t).fail();
25 #endif