etl/docs/utilities/etl-traits.md
John Wellbelove 4a88884b39
Issue/add hugo support for documentation (#1449)
* Add ranges

* Initial Hugo setup

* Work in progress

* Added selection for local or remote site

* Updated to 'light' theme

* Changed to using Hextra Hugo theme

* Changed to using Hextra Hugo theme

* Changed to Hextra Hugo theme

* Change to Hextra Hugo theme

* Updated Hugo setup.

* Updated Hugo setup.

# Conflicts:
#	docs/releases/_index.md

* Work in progress

* Added new fonts

Added new documentation

* Latest documentation updates

* Latest documentation updates

# Conflicts:
#	docs/containers/array.md
#	docs/containers/array_view.md
#	docs/containers/array_wrapper.md
#	docs/containers/bip_buffer_spsc_atomic.md
#	docs/containers/bitset.md
#	docs/containers/indirect_vector.md
#	docs/containers/vector.md
#	docs/getting-started/compilers.md

* Added bloom_filter markdown doc

* Added more documentation

Updated CSS for light and dark modes

* Fixed some menus

Added mode documentation files

* Updated CSS rules

Added badges to home page
Added uniqur_ptr + pool tutorial

* Fixed formatting on the home page markdown

Modified light amd dark code formatting

* Updated unique_ptr-with-pool

* Added container and shared message tutorials

* Updates to documentation

* Added const_multimap

* Updated source-formatting.md

* Added initial raw text files form Web site editor

* Innore coverage build directory

* Exported raw text documentation files from the web site editor

* Hugo updates

* Added Hugo intalation and markdown descriptions

* More addition to the documentation

* Added closure.md and updates to delegate.md

* Added format.md

* Added documentation for etl::delegate_observable, etl::function, Base64 codec

* Added io_port documentation

* Added basic_format_spec

* Added documentation for string_stream and string utilities.

* Added more documentation

Updated the documentation CSS

* Added documentation for clocks, day, duration

* Added more documentation for chrono classes

Updated callouts

* More chrono documentation

* Completed chrono documentation

* Maths functions documentation

* Completed maths documentation

* Completed maths documentation

* Completed maths documentation

* Completed maths documentation

* Added multiple documentation files

* Added iterator.md

* Added debug_count.md and versions.md

* Added debug_count.md and versions.md

* Added more documentation

* More documentation

* Added some design pattern documentation

Modified some of the layout files
Modified the About documentation

* Converted more documentation pages

Modified the site CSS

* Added more documentation

Moced some documentation files to new directories

* Added more documentation

Tweaks to CSS

* Added callback_timer_deferred_locked documentation

* Added callback_timer_locked documentation

* More documentation updates

* More documentation updates

* More documentation updates

* New documentation files.

Harmonised file name format

* New documentation files.

* Multiple document updates

* Multiple document updates

* Final conversion of web pages

* Updates before PR

* Updates before PR

* Updates before PR

# Conflicts:
#	docs/blog/_index.md

* Final pre PR updates

* Updates to message framework documentation

* Renamed directory

* Fix spelling

* Added author and date to blog files

Moved documentation files merged from development

* Fixed 'Description' typo

* Fix typos

# Conflicts:
#	docs/IO/io_port.md
#	docs/containers/sets/const-multiset.md
#	docs/containers/sets/const-set.md
#	docs/maths/correlation.md
#	docs/maths/gamma.md

* Renamed two files to lower case

* Minor renaming

* Added author and date

* Updated callout on bresenham_line.md

Added support for showing the ETL version on the documentation first page, by copying the version.txt file as a hugo asset.
Updated the Python 'update_release.py' to copy 'version.txt'

* Replace space in filename with hyphen.

Added more information to hugo-commands.md

* Replace space in filename with hyphen.

Added more information to hugo-commands.md

# Conflicts:
#	docs/getting-started/view-the-docs-locally/hugo-commands.md

* Added a link to pseudo_moving_average.md

* Updated title pages for groups

* Fixed missing 404 for non-existent pages

* Fixed coordinate variable names in the 'Calculating the intersection' example

---------

Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
2026-06-06 13:12:44 +01:00

6.7 KiB

title
ETL Traits

{{< callout type="info">}} Header: various
Since: TBC
{{< /callout >}}

A set of traits that reflect the platform settings. It gives a C++ style interface to the library macros. The traits are accessed under the etl::traits namespace. All traits are constexpr for C++11 and above, const for C++03 and below.

Traits

Trait Type Defined by Macro
using_stl bool platform.h ETL_USING_STL
using_stlport bool platform.h ETL_USING_STLPORT
using_cpp11 bool platform.h ETL_USING_CPP11
using_cpp14 bool platform.h ETL_USING_CPP14
using_cpp17 bool platform.h ETL_USING_CPP17
using_cpp20 bool platform.h ETL_USING_CPP20
using_cpp23 bool platform.h ETL_USING_CPP23
cplusplus long builtin __cplusplus
language_standard int platform.h ETL_LANGUAGE_STANDARD
using_exceptions bool platform.h ETL_USING_EXCEPTIONS
using_gcc_compiler bool platform.h ETL_USING_GCC_COMPILER
using_microsoft_compiler bool platform.h ETL_USING_MICROSOFT_COMPILER
using_arm5_compiler bool platform.h ETL_USING_ARM5_COMPILER
using_arm6_compiler bool platform.h ETL_USING_ARM6_COMPILER
using_arm7_compiler bool platform.h ETL_USING_ARM7_COMPILER
using_clang_compiler bool platform.h ETL_USING_CLANG_COMPILER
using_green_hills_compiler bool platform.h ETL_USING_GREEN_HILLS_COMPILER
using_iar_compiler bool platform.h ETL_USING_IAR_COMPILER
using_intel_compiler bool platform.h ETL_USING_INTEL_COMPILER
using_texas_instruments_compiler bool platform.h ETL_USING_TEXAS_INSTRUMENTS_COMPILER
using_builtin_is_assignable bool platform.h ETL_USING_BUILTIN_IS_ASSIGNABLE
using_builtin_is_constructible bool platform.h ETL_USING_BUILTIN_IS_CONSTRUCTIBLE
using_builtin_is_trivially_constructible bool platform.h ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE
using_builtin_is_trivially_destructible bool platform.h ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE
using_builtin_is_trivially_copyable bool platform.h ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE
using_builtin_underlying_type bool platform.h ETL_USING_BUILTIN_UNDERLYING_TYPE
using_builtin_memcpy bool platform.h ETL_USING_BUILTIN_MEMCPY
using_builtin_memmove bool platform.h ETL_USING_BUILTIN_MEMMOVE
using_builtin_memset bool platform.h ETL_USING_BUILTIN_MEMSET
using_builtin_memcmp bool platform.h ETL_USING_BUILTIN_MEMCMP
using_builtin_memchr bool platform.h ETL_USING_BUILTIN_MEMCHR
using_generic_compiler bool platform.h ETL_USING_GENERIC_COMPILER
has_8bit_types bool platform.h ETL_USING_8BIT_TYPES
has_64bit_types bool platform.h ETL_USING_64BIT_TYPES
has_atomic bool platform.h ETL_HAS_ATOMIC
has_mutex bool mutex.h ETL_HAS_MUTEX
has_nullptr bool platform.h ETL_HAS_NULLPTR
has_char8_t bool platform.h ETL_HAS_CHAR8_T
has_native_char8_t bool platform.h ETL_HAS_NATIVE_CHAR8_T
has_native_char16_t bool platform.h ETL_HAS_NATIVE_CHAR16_T
has_native_char32_t bool platform.h ETL_HAS_NATIVE_CHAR32_T
has_string_truncation_checks bool platform.h ETL_HAS_STRING_TRUNCATION_CHECKS
has_error_on_string_truncation bool platform.h ETL_HAS_ERROR_ON_STRING_TRUNCATION
has_string_clear_after_use bool platform.h ETL_HAS_STRING_CLEAR_AFTER_USE
has_istring_repair bool platform.h ETL_HAS_ISTRING_REPAIR
has_ivector_repair bool platform.h ETL_HAS_IVECTOR_REPAIR
has_mutable_array_view bool platform.h ETL_HAS_MUTABLE_ARRAY_VIEW
has_ideque_repair bool platform.h ETL_HAS_IDEQUE_REPAIR
has_initializer_list bool platform.h ETL_HAS_INITIALIZER_LIST
is_debug_build bool platform.h ETL_IS_DEBUG_BUILD
version long version.h ETL_VERSION_VALUE
version_major long version.h ETL_VERSION_MAJOR
version_minor long version.h ETL_VERSION_MINOR
version_patch long version.h ETL_VERSION_PATCH
version_string const char* version.h ETL_VERSION
version_wstring const wchar_t * version.h ETL_VERSION_W
version_u8string const char8_t* version.h ETL_VERSION_U8 if has_native_char8_t
version_u16string const char16_t* version.h ETL_VERSION_U16
version_u32string const char32_t* version.h ETL_VERSION_U32

Examples

if constexpr(etl::traits::is_debug_build)
{
  std::cerr << etl::traits::version_string;
}

template <bool Has_Atomic = etl::traits::has_atomic>
class Controller;

template<>
class Controller<false>
{
  etl::mutex lock;
};

template<>
class Controller<true>
{
  etl::atomic_int lock;
};