NumToStr.h 935 Bytes
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef OPAL_NumToStr_HH
#define OPAL_NumToStr_HH 1

// ------------------------------------------------------------------------
// $RCSfile: NumToStr.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.2.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// ------------------------------------------------------------------------
//
// $Date: 2004/11/12 20:10:12 $
// $Author: adelmann $
//
// ------------------------------------------------------------------------

#include <sstream>
snuverink_j's avatar
snuverink_j committed
20
#include <string>
gsell's avatar
gsell committed
21 22 23 24

/// Convert number to string.
//  Return the string corresponding to the numeric argument.

snuverink_j's avatar
snuverink_j committed
25 26 27 28 29 30
template <typename T>
std::string NumToStr(T t) {
    std::ostringstream oss;
    oss << t;
    return oss.str();
}
gsell's avatar
gsell committed
31 32

#endif // OPAL_NumToStr_HH