-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfinal.cpp
More file actions
28 lines (24 loc) · 716 Bytes
/
final.cpp
File metadata and controls
28 lines (24 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//*****************************************************************************
//
// Author: Michael Price
// License: Attribution-NonCommercial-NoDerivs 3.0 Unported
// http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
//
//*****************************************************************************
struct IMaiar
{
virtual bool shallYouPass () = 0;
};
struct GandalfGrey : public IMaiar
{
virtual bool shallYouPass () { return false; }
};
struct GandalfWhite final : public GandalfGrey
{
virtual bool shallYouPass () { return true; }
};
// struct GandalfWashedOut : public GandalfWhite
// {
// virtual bool shallYouPass ()
// { throw "Why bother"; return false; }
// };