#include #include "boost/type_traits/add_reference.hpp" template struct foopair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; foopair(typename boost::add_reference::type nfirst, typename boost::add_reference::type nsecond) :first(nfirst), second(nsecond) { } }; using namespace std; int main() { int i=5; char j='a'; foopair ij( i, j); cout << "i = " << i << endl; cout << "j = " << j << endl; cout << "ij.first= " << ij.first << endl; cout << "ij.second= " << ij.second << endl; i = 10; j = 'c'; cout << "i = " << i << endl; cout << "j = " << j << endl; cout << "ij.first= " << ij.first << endl; cout << "ij.second= " << ij.second << endl; return 0; }