Go to Overview over all GrAL packages.
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Utility/as-string.h

Go to the documentation of this file.
00001 #ifndef NMWR_GB_AS_STRING_H
00002 #define NMWR_GB_AS_STRING_H
00003 
00004 
00005 
00006 // $LICENSE
00007 
00008 
00009 
00010 #include <strstream.h>
00011 #include <string>
00012 
00013 template<class T>
00014 inline std::string as_string(const T& t)
00015 {
00016   std::strstream s;
00017   s << t << std::ends;
00018   int n = strlen(s.str());
00019   char* copy = new char[n+1];
00020   strcpy(copy,s.str());
00021  
00022   return std::string(copy);
00023 }
00024 
00025 #endif

Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 15:57:02 2002 for Utilities by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000