GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by Anonymous
1
 
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

class MultiString {
    std::string str;
//    std::stringstream tempStrStream;
public:
    MultiString( std::string t ) : str(t) {}
    template< class T >
        T To() { 
            static T output;
            static std::stringstream tempStrStream;
            static int test = 0;
            cout << test++ << endl;
            tempStrStream.str( str );        
            tempStrStream >> output;
            return output;
        }
    template<>
        bool To() {
            return (str=="true"?true:false);
        }
};