#include <iostream>
class Pop3Adaptor
{
private:
const char* user_id;
public:
Pop3Adaptor() : user_id( "Initial" ){}
Pop3Adaptor( const char* user_id ) : user_id( user_id ){}
const char* User() const;
};
const char* Pop3Adaptor::User() const
{
return user_id;
}
int main( int argc, char* argv[] )
{
// With default constructor
Pop3Adaptor adaptor_a;
std::cout << adaptor_a.User() << std::endl;
Pop3Adaptor adaptor_b( "Foo" );
std::cout << adaptor_b.User() << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgUG9wM0FkYXB0b3IKewpwcml2YXRlOgoJY29uc3QgY2hhciogdXNlcl9pZDsKcHVibGljOgoJUG9wM0FkYXB0b3IoKSA6IHVzZXJfaWQoICJJbml0aWFsIiApe30KCVBvcDNBZGFwdG9yKCBjb25zdCBjaGFyKiB1c2VyX2lkICkgOiB1c2VyX2lkKCB1c2VyX2lkICl7fQoJY29uc3QgY2hhciogVXNlcigpIGNvbnN0Owp9OwogCmNvbnN0IGNoYXIqIFBvcDNBZGFwdG9yOjpVc2VyKCkgY29uc3QKewoJcmV0dXJuIHVzZXJfaWQ7Cn0KCmludCBtYWluKCBpbnQgYXJnYywgY2hhciogYXJndltdICkgCnsKCS8vIFdpdGggZGVmYXVsdCBjb25zdHJ1Y3RvcgoJUG9wM0FkYXB0b3IgYWRhcHRvcl9hOwoJc3RkOjpjb3V0IDw8IGFkYXB0b3JfYS5Vc2VyKCkgPDwgc3RkOjplbmRsOwoJCglQb3AzQWRhcHRvciBhZGFwdG9yX2IoICJGb28iICk7CglzdGQ6OmNvdXQgPDwgYWRhcHRvcl9iLlVzZXIoKSA8PCBzdGQ6OmVuZGw7CgkKCXJldHVybiAwOwp9