From 2d1a96d3dd0efae38d8a29976da24a812dbaad4c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 3 Mar 2012 21:06:12 -0800 Subject: [PATCH] add include/stringify.h Signed-off-by: Sage Weil --- src/Makefile.am | 1 + src/include/stringify.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/include/stringify.h diff --git a/src/Makefile.am b/src/Makefile.am index a37392d436fcf..6f070b45d342b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1253,6 +1253,7 @@ noinst_HEADERS = \ include/rbd_types.h\ include/statlite.h\ include/str_list.h\ + include/stringify.h\ include/triple.h\ include/types.h\ include/utime.h\ diff --git a/src/include/stringify.h b/src/include/stringify.h new file mode 100644 index 0000000000000..f87bd983a4774 --- /dev/null +++ b/src/include/stringify.h @@ -0,0 +1,14 @@ +#ifndef __CEPH_STRINGIFY_H +#define __CEPH_STRINGIFY_H + +#include +#include + +template +inline std::string stringify(T a) { + std::stringstream ss; + ss << a; + return ss.str(); +} + +#endif -- 2.39.5