Skip to content

C++11 header-only meta-programming & compile-time utilities library

License

Notifications You must be signed in to change notification settings

inobelar/compiletime-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP: Compile-Time utilities library

Written with type-traits (structures, with specialization for types) with extentibility by custom types in mind.

Written for c++11, without such useful things like:

  • fold expression - since c++17
  • variable declaration & if/switch/for in constexpr functions
  • std::index_sequence - since c++14

For enabling in-place compile-time tests (useful during hacking) - add CT_ENABLE_TESTS define.

Including into your project

This library is header-only (since most of the code is non-splitable template magic), so for usage in your codebase, simply add /include/ directory into include search path.

For example:

  • CMake - References: How to properly add include directories with CMake, CMake::include_directories()
    • Add into CMakeLists.txt:
      set(THIS_LIB_INCLUDE_DIR <path/to/compiletime-utils/include/> )
      target_include_directories( <YOUR_TARGET_NAME> PRIVATE ${THIS_LIB_INCLUDE_DIR})
  • QMake - In project_name.pro file add next line:
    • Add all includes as part of the project:
      include(<path/to/compiletime-utils/include>/ct.pri)
      include(<path/to/compiletime-utils/include>/rt.pri)
    • Add all includes simply into search path:
      INCLUDEPATH += <path/to/compiletime-utils/include/>
  • gcc/g++ single-file compilation:
    • $ gcc -c -std=c++11 -O2 -I <path/to/compiletime-utils/include> -o <app_name> main.cpp

About

C++11 header-only meta-programming & compile-time utilities library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages