close
Namespaces
Variants

Template talk:cpp/utility/lang feature macros

From cppreference.com

FTM counter

Prints the number of Feature-Testing Macros in the table if supplied with its content. Can be used online.

#include <iostream>
#include <algorithm>
#include <ranges>
#include <string_view>
 
int main()
{
    extern const std::string_view table;
    constexpr std::string_view substr {"__cpp_"};

    std::cout << "Total number of macros: " <<
        std::ranges::count_if(table | std::views::split(substr),
            [](...) { return true; } ) - 1 << '\n';
}

constexpr std::string_view table = R"---(

// Manually add the content of [[Template:cpp/utility/lang feature macros]]

)---";

--Space Mission (talk) 05:32, 10 April 2023 (PDT)

__cpp_trivially_relocatable

There is no __cpp_trivially_relocatable in P2786R13. Benio (talk) 03:52, 11 March 2025 (PDT)