awtools.h
#ifndef AWTOOLS_H_
#define AWTOOLS_H_
#include <sstream>
namespace AWTookit
{
template<class Target, class Source> Target lexical_cast(Source arg)
{
std::stringstream interpreter;
Target result;
if(!(interpreter<<arg)||!(interpreter>>result)||!(interpreter>>std::ws).eof())
throw std::bad_cast();
return result;
}
extern int get_process_id();
extern std::string replace_space(const std::string& str);
}
#endif
#define AWTOOLS_H_
#include <sstream>
namespace AWTookit
{
template<class Target, class Source> Target lexical_cast(Source arg)
{
std::stringstream interpreter;
Target result;
if(!(interpreter<<arg)||!(interpreter>>result)||!(interpreter>>std::ws).eof())
throw std::bad_cast();
return result;
}
extern int get_process_id();
extern std::string replace_space(const std::string& str);
}
#endif