How would this template code run?

using namespace std;

namespace ns{
class A{
template<typename T>
void operator<< (T str){
cout<< str;

class B{
template<typename S>
void operator>> (S &object){
cin>> object; }
void operator>> <string> (S &object){
getline(cin>> object);
A show;
B enter;

int main(){
using namespace ns;
string b;
enter>> b;
show<< b;

This code is basically giving new names to objects cout and cin...
The error is generated at specializing the template at line 19 template<>...
I do not know where there is the line 19 because as all stupid guys you did not point out neither the line 19 nor the full error message. But in any case this statement

getline(cin>> object);

is invalid.

Topic archived. No new replies allowed.