Skip to content

File counter.h

FileList > module > utility > src > scl > utility > preprocessor > counter.h

Go to the source code of this file

Implements a compile-time counter mechanism. More...

  • #include <scl/utility/preprocessor/forward.h>
  • #include <cstdint>
  • #include <type_traits>

Namespaces

Type Name
namespace scl
Root namespace of ScL project.
namespace preprocessor

Macros

Type Name
define SCL_COUNTER_CRUMB (Tag, rank, acc) /* multi line expression */

Detailed Description

This file provides a set of macros and templates to create and increment counters that are evaluated at compile time. This technique is based on function overloading and argument-dependent lookup (ADL). It's useful for generating unique IDs or counting occurrences of something within a translation unit during compilation.

See also: https://stackoverflow.com/a/6174263/1190123

Macro Definition Documentation

define SCL_COUNTER_CRUMB

#define SCL_COUNTER_CRUMB (
    Tag,
    rank,
    acc
) `/* multi line expression */`


The documentation for this class was generated from the following file module/utility/src/scl/utility/preprocessor/counter.h