Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
cxx_standard.cc
Go to the documentation of this file.
1/*
2 Aleph_w
3
4 Data structures & Algorithms
5 version 2.0.0b
6 https://github.com/lrleon/Aleph-w
7
8 This file is part of Aleph-w library
9
10 Copyright (c) 2002-2026 Leandro Rabindranath Leon
11*/
12
24#include <cstdio>
25
26#include <tpl_array.H>
27
28// MSVC keeps __cplusplus at 199711L without /Zc:__cplusplus; _MSVC_LANG
29// holds the standard in use.
30#if defined(_MSVC_LANG)
31# define CXX_STANDARD_IN_USE _MSVC_LANG
32#else
33# define CXX_STANDARD_IN_USE __cplusplus
34#endif
35
36static_assert(CXX_STANDARD_IN_USE >= 202002L,
37 "Aleph::Aleph did not give its consumer C++20");
38#if EXPECT_NEWER_THAN_CXX20
39static_assert(CXX_STANDARD_IN_USE > 202002L,
40 "the C++23 chosen by the consumer was not kept");
41#endif
42
43int main()
44{
46 a.append(1);
47 a.append(2);
48 std::printf("C++ standard in use: %ld\n", static_cast<long>(CXX_STANDARD_IN_USE));
49 return a.size() == 2 ? 0 : 1;
50}
Simple dynamic array with automatic resizing and functional operations.
Definition tpl_array.H:141
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
Definition tpl_array.H:450
T & append(const T &data)
Append a copy of data
Definition tpl_array.H:331
#define CXX_STANDARD_IN_USE
int main()
Dynamic array container with automatic resizing.