CbmRoot
Loading...
Searching...
No Matches
LitUtils.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2013 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
15#ifndef LITUTILS_H_
16#define LITUTILS_H_
17
18#include <sstream>
19#include <string>
20
21namespace lit
22{
23 namespace parallel
24 {
25
36 template<class T>
37 std::string ToString(const T& value)
38 {
39 std::stringstream ss;
40 ss.precision(5);
41 ss << value;
42 return ss.str();
43 }
44
45
59 public:
60 template<typename T>
61 void operator()(const T* ptr) const
62 {
63 delete ptr;
64 }
65 };
66
67 } // namespace parallel
68} // namespace lit
69#endif /* LITUTILS_H_ */
Functor class for convenient memory release.
Definition LitUtils.h:58
void operator()(const T *ptr) const
Definition LitUtils.h:61
std::string ToString(const T &value)
Function converts object into a std::string.
Definition LitUtils.h:37