| 1 |
/*************************************************************************************** |
| 2 |
* This file is dedicated to the public domain. If your jurisdiction requires a * |
| 3 |
* specific license: * |
| 4 |
* * |
| 5 |
* Copyright (c) Stephen McDowell, 2017-2024 * |
| 6 |
* License: CC0 1.0 Universal * |
| 7 |
* License Text: https://creativecommons.org/publicdomain/zero/1.0/legalcode * |
| 8 |
**************************************************************************************/ |
| 9 |
/** |
| 10 |
* \file |
| 11 |
* |
| 12 |
* \brief This file should be one level down in the hierarchy. |
| 13 |
*/ |
| 14 |
#pragma once |
| 15 |
|
| 16 |
namespace nested { |
| 17 |
/// The second class inside the ``nested`` namespace. |
| 18 |
struct two { |
| 19 |
/// Nesting even further: ``nested::two::params``. |
| 20 |
struct params { |
| 21 |
/// A union that occupies four bytes: https://en.cppreference.com/w/cpp/language/union |
| 22 |
union four_bytes { |
| 23 |
std::int32_t n; ///< occupies 4 bytes |
| 24 |
std::uint16_t s[2];///< occupies 4 bytes |
| 25 |
std::uint8_t c; ///< occupies 1 byte |
| 26 |
}; |
| 27 |
|
| 28 |
/// Returns ``true`` ;) |
| 29 |
bool compiles() { return true; } |
| 30 |
}; |
| 31 |
|
| 32 |
/// Returns ``true`` ;) |
| 33 |
bool compiles() { return true; } |
| 34 |
}; |
| 35 |
|
| 36 |
/// A union that occupies four bytes: https://en.cppreference.com/w/cpp/language/union |
| 37 |
union four_bytes { |
| 38 |
std::int32_t n; ///< occupies 4 bytes |
| 39 |
std::uint16_t s[2];///< occupies 4 bytes |
| 40 |
std::uint8_t c; ///< occupies 1 byte |
| 41 |
}; |
| 42 |
} |