Stroika Library 3.0d23
 
Loading...
Searching...
No Matches
Foundation/Common/Common.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Common_Common_h_
5#define _Stroika_Foundation_Common_Common_h_ 1
6
7#include <cstddef>
8#include <cstdint>
9
10namespace Stroika {
11 using namespace std;
12
13 // deal with windows ambiguity - C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared\rpcndr.h(202): note: could be 'unsigned char byte'
14 using std::byte;
15}
16
18
19 /**
20 * \def nonvirtual
21 * Is for documentation purposes, to make clear a method is intended to be not 'virtual'
22 *
23 * \par Example Usage
24 * \code
25 * // Conventional std c++
26 * struct base {
27 * int f1 ();
28 * virtual int f2();
29 * };
30 * struct derived : base {
31 * // f2 is a virtual override here, but it sure isn't clear from the declaration
32 * int f2 ();
33 * };
34 *
35 * // In Stroika, this will always be written as:
36 * struct base {
37 * nonvirtual int f1 ();
38 * virtual int f2();
39 * };
40 * struct derived : base {
41 * // f2 is a virtual override here, but it sure isn't clear from the declaration
42 * virtual int f2 () override;
43 * };
44 * \endcode
45 *
46 * So its always clear at the point of declaration if a function is virtual or not, and if virtual, if its
47 * a new virtual or override.
48 *
49 * \note This is \em not really enforced by the compiler (the 'conventional std c++ code' produces no diagnostic).
50 */
51#define nonvirtual
52
53}
54
55/*
56 ********************************************************************************
57 ***************************** Implementation Details ***************************
58 ********************************************************************************
59 */
60
61#endif /*_Stroika_Foundation_Common_Common_h_*/
STL namespace.