Stroika Library 3.0d23
 
Loading...
Searching...
No Matches
Empty.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Common_Empty_h_
5#define _Stroika_Foundation_Common_Empty_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <type_traits>
10
11/**
12 * \file
13 *
14 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
15 */
16
18
19 /**
20 * Believe it or not, this is often useful in template metaprogramming. Because you cannot declare a data member as 'void'. This amounts to same thing if used with [[no_unique_address]]/qStroika_ATTRIBUTE_NO_UNIQUE_ADDRESS
21 */
22 struct Empty {
23 /**
24 * Ignore any initializers, so can be used more easily in contexts where initializing with some random argument to be later ignored.
25 */
26 template <typename... ARGS>
27 constexpr Empty (ARGS...)
28 {
29 }
30 };
31 static_assert (std::is_empty_v<Empty>);
32
33}
34
35/*
36 ********************************************************************************
37 ***************************** Implementation Details ***************************
38 ********************************************************************************
39 */
40
41#endif /*_Stroika_Foundation_Common_Empty_h_*/
constexpr Empty(ARGS...)
Definition Empty.h:27