>Опечатка в первой программе
>
>>class MyClass:public
>а должно быть :
>
>class MyClass:public E
Did not get it...
#include <iostream>
#include <string>
class AAA {
std::string s_;
AAA( const AAA& aaa ) {}
void operator=( const AAA& aaa ) {}
public:
explicit AAA( const char *s ) : s_( s ) {}
friend std::ostream& operator << ( std::ostream& os, const AAA& a );
};
std::ostream& operator<<( std::ostream& os, const AAA& a )
{
return os << a.s_;
}
struct Policy
{
template<typename F>
static void DoSomething( const F& obj )
{
std::cout << obj << "\n";
}
};
template<class E>
class MyClass : public E
{
/*...............*/
};
int main()
{
MyClass<Policy> my;
my.DoSomething( 234.567 );
AAA aaa( "aaa instance of the AAA" );
my.DoSomething( aaa );
}
??? So what is the problem
Thanks
--- sas