Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo {
- public:
- Foo(double nw): x(nw) { };
- virtual ~Foo() = default;
- inline operator double() noexcept { return x; }
- private:
- double x = double();
- };
- class Bar : public Foo {
- using Foo::Foo;
- public:
- ~Bar() = default;
- inline operator double() noexcept { return Foo::operator double(); }
- };
- int _tmain(int argc, _TCHAR* argv[])
- {
- Bar d(4.2);
- std::cout << d;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement