[ create a new paste ] login | about

Link: http://codepad.org/ODBfNNW2    [ raw code | output | fork ]

gumbeto - C++, pasted on Jan 16:
#include <utility>
#include <iostream>

namespace Testing
{
    template<typename T>
    struct CmdArg
    {
        typedef std::pair<T, bool> type;
    };
    
    template<typename T>
    CmdArg<T>::type f(const T& t)
    {
        return CmdArg<T>::type(t, false);
    }
}

int main()
{
    Testing::CmdArg<int>::type arg = Testing::f(11);
    
    std::cout << arg.first << " " << arg.second << std::endl;
}


Output:
1
2
Line 13: error: expected constructor, destructor, or type conversion before 'f'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: