Free Electron
Final.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 
8 /**************************************************************************//**
9  @brief Base class that prevents further derivation
10 
11  @ingroup core
12 
13  Usage:
14  @code
15  class MyFinal: virtual Final< MyFinal >
16  {
17  }
18  @endcode
19 
20  By making it virtual, the most derived class calls the constructor,
21  which is hidden from all but the immediate derived class.
22 
23  Note that this requires changes to the standard that may still be pending.
24  Otherwise, it is an error.
25 *//***************************************************************************/
26 template<typename T>
27 class Final
28 {
29  Final(void) {}
30 
31 friend class T;
32 };
Base class that prevents further derivation.
Definition: Final.h:27