Added toString template

This commit is contained in:
Andreas Huggel 2004-02-05 03:43:37 +00:00
parent cd45eb0e5c
commit 5ea9faf79e

View File

@ -21,7 +21,7 @@
/*!
@file tags.hpp
@brief %Exif tag and type information
@version $Name: $ $Revision: 1.7 $
@version $Name: $ $Revision: 1.8 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 15-Jan-04, ahu: created
@ -250,6 +250,15 @@ namespace Exif {
// No default implementation: let the compiler/linker complain
// template<typename T> inline TypeId getType() { return invalid; }
//! Utility function to convert the argument of any type to a string
template<typename T>
std::string toString(T arg)
{
std::ostringstream os;
os << arg;
return os.str();
}
} // namespace Exif
#endif // #ifndef TAGS_HPP_