CallableTraits

Build Status

Gitter

Try it online

CallableTraits is a small, header-only library providing a uniform and comprehensive interface for the type-level manipulation of all callable types in C++.

Documentation Here

Compatibility

CallableTraits is currently tested and working on the following platforms, unless otherwise noted:

  • GNU/Linux
    • clang 3.5 and later (both libc++ and libstdc++)
    • gcc 5.2 and later
  • OSX
    • Apple Xcode 6.3 and later
    • open-source clang 3.5 and later should work, but is not tested
  • Windows
    • Microsoft Visual Studio 2015 (native MSVC)
    • MinGW32 gcc 5.3 (other versions not tested)
    • clang-cl in Visual Studio's LLVM toolkit cannot build CallableTraits tests because of this curious bug. I filed a bug report, but I should be able to work around it when I find the time to do so.

I do not know the compatibility of CallableTraits for other/older compilers, but the stdlib implementation must include std::index_sequence and friends.

Building the tests and examples

First, you'll need a recent version of CMake. These commands assume that git and cmake are available in your environment path. If you need help with this, message me on Gitter.

GNU/Linux/OSX

Open a shell and enter the following commands:

git clone http://github.com/badair/callable_traits
cd callable_traits
mkdir build
cd build
cmake ..
make check

If your system doesn't have a default C++ compiler, or your default C++ compiler is too old, you'll need to point CMake to a compatible C++ compiler like this, before running make check:

cmake .. -DCMAKE_CXX_COMPILER=/path/to/compiler

CMake should yell at you if your compiler is too old.

Windows

Cygwin/MSYS/MSYS2 users should refer to the Linux section. For Visual Studio 2015, fire up cmd.exe and enter the following commands:

git clone http://github.com/badair/callable_traits
cd callable_traits
mkdir build
cd build
cmake .. -G"Visual Studio 14 2015 Win64"

Then, open the generated callable_traits.sln solution file in Visual Studio.

See Also

CallableTraits is a spin-off of a sillier, messier, more experimental project of mine called CLBL, which has a storied commit history.

License

Please see LICENSE.md.

Description
Mirrored via gitea-mirror
Readme 2.3 MiB
Languages
C++ 97.6%
CMake 2.1%
Shell 0.2%
HTML 0.1%