/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <cassert>
using namespace std;
struct Foo {
std::string first_name;
std::string last_name;
int age;
};
struct TestFoo : public Foo {
TestFoo() : Foo() {
first_name = "John";
last_name = "Doe";
age = 42;
}
};
void DoFoo(const Foo& foo) {
std::cout << "Foo:" << std::endl;
std::cout << foo.first_name << std::endl;
std::cout << foo.last_name << std::endl;
std::cout << foo.age << std::endl;
assert(foo.age > 0);
}
int main()
{
DoFoo(TestFoo{});
return 0;
}