OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
NumToStr.h
Go to the documentation of this file.
1 #ifndef OPAL_NumToStr_HH
2 #define OPAL_NumToStr_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: NumToStr.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.2.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2004/11/12 20:10:12 $
15 // $Author: adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include <sstream>
20 #include <string>
21 
23 // Return the string corresponding to the numeric argument.
24 
25 template <typename T>
26 std::string NumToStr(T t) {
27  std::ostringstream oss;
28  oss << t;
29  return oss.str();
30 }
31 
32 #endif // OPAL_NumToStr_HH
Definition: rbendmap.h:8
std::string NumToStr(T t)
Convert number to string.
Definition: NumToStr.h:26