Skip to content

Instantly share code, notes, and snippets.

@kingsamchen
Created July 6, 2013 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingsamchen/5939601 to your computer and use it in GitHub Desktop.
Save kingsamchen/5939601 to your computer and use it in GitHub Desktop.
//// C#
class SeqTest
{
string _inClassName;
public string InClassName
{
get {return _inClassName;}
set {_inClassName = value;}
}
public SeqTest(string className)
{
InClassName = className;
Console.WriteLine("In " + InClassName);
}
}
class Person
{
public SeqTest test = new SeqTest("Person");
public string Name
{
get;
set;
}
public int Age
{
get;
set;
}
}
class Employer : Person
{
public SeqTest another = new SeqTest("Employer");
}
///// C++
class SeqTest
{
public:
SeqTest()
{
}
SeqTest(const char* className)
{
cout<<"In "<<className<<endl;
}
};
class Foo
{
public:
Foo() : seq("Foo")
{
}
private:
SeqTest seq;
};
class FooF : public Foo
{
public:
FooF() : another("FooF")
{
}
private:
SeqTest another;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment