plastimatch
Loading...
Searching...
No Matches
make_string.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _make_string_h_
5#define _make_string_h_
6
7#include "plmbase_config.h"
8#include <iomanip>
9#include <sstream>
10
11template <class T>
12static std::string
14 T t,
15 int width = 0,
16 char fill = ' ',
17 std::ios_base & (*f)(std::ios_base&) = std::dec
18)
19{
20 std::stringstream ss;
21 ss << std::setw (width);
22 ss << std::setfill (fill);
23 ss << f << t;
24 return ss.str();
25}
26
27#endif
static std::string make_string(T t, int width=0, char fill=' ', std::ios_base &(*f)(std::ios_base &)=std::dec)
Definition make_string.h:13