Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
ConceptsBase.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Common_ConceptsBase_h_
5#define _Stroika_Foundation_Common_ConceptsBase_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <type_traits>
10
11/*
12 * ********* DEPRECATED *******
13 */
14
16
17 DISABLE_COMPILER_MSC_WARNING_START (4996);
18 DISABLE_COMPILER_GCC_WARNING_START ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
19 DISABLE_COMPILER_CLANG_WARNING_START ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
20 using namespace std;
21
22 /**
23 * LIFTED -@todo add docs/reference
24 * from Stroustrup C++11 book - page 800
25 */
26 struct [[deprecated ("Since Stroika v3 - use concepts")]] substitution_failure {};
27
28 /**
29 * LIFTED -@todo add docs/reference
30 * from Stroustrup C++11 book - page 800
31 */
32 template <typename T>
33 struct [[deprecated ("Since Stroika v3 - use concepts")]] substitution_succeeded : true_type {};
34 template <>
35 struct substitution_succeeded<substitution_failure> : false_type {};
36
37 /**
38 *
39 * // just needed til we have c++ 20 concepts
40 *
41 * Credit to https://stackoverflow.com/users/16746390/kenash0625
42 * For his suggestion in https://stackoverflow.com/questions/70119120/how-to-fix-sfinae-check-for-operator-existing-so-that-it-works-with-stdpair/70122139#70122139
43 * See also Detection Idioms - https://segmentfault.com/a/1190000040852065/en
44 */
45 template <template <typename...> typename Detector, typename T, typename SFINAE = void>
46 [[deprecated ("Since Stroika v3 - use concepts")]] constexpr inline bool is_detected_v = false;
47 template <template <typename...> typename Detector, typename T>
48 constexpr inline bool is_detected_v<Detector, T, std::void_t<Detector<T>>> = true;
49
50 DISABLE_COMPILER_MSC_WARNING_END (4996);
51 DISABLE_COMPILER_GCC_WARNING_END ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
52 DISABLE_COMPILER_CLANG_WARNING_END ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
53
54}
55
56/*
57 ********************************************************************************
58 ***************************** Implementation Details ***************************
59 ********************************************************************************
60 */
61
62#endif /*_Stroika_Foundation_Common_ConceptsBase_h_ */
STL namespace.