Skip to content

A const-propagating member-pointer-wrapper for the C++ standard library

License

Notifications You must be signed in to change notification settings

Twon/propagate_const

 
 

Repository files navigation

A const-propagating member-pointer-wrapper for the C++ standard library

travis appveyor codecov language license issues

On 2015-02-25 a proposal was accepted by the Library Working Group as N4388 and will be put forward for inclusion in Library Fundamentals Technical Specification V2.

Contents

Integration

Propagate const is shipped as a single header file, propagate_const.h that can be directly included in your project or included via an official release package.

CMake

To include in your CMake build then add a dependency upon the interface target, propagate_const::propagate_const. This provides the necessary include paths and C++ features required to include propagate_const into your project.

External

To include propagate_const you will need use find package to locate the provided namespace imported targets from the generated package configuration. The package configuration file, propagate_const-config.cmake can be included from the install location or directly out of the build tree.

# CMakeLists.txt
find_package(propagate_const 1.0.0 REQUIRED)
...
add_library(foo ...)
...
target_link_libraries(foo PRIVATE propagate_const::propagate_const)

Building

The project contains a helper scripts for building that can be found at /scripts/build.py. The project can be build with the helper script as follows:

Conan

conan create <project root> [--test-folder None]

Dependencies

Building Manually Via CMake

It is possible to build the project manually via CMake for a finer grained level of control regarding underlying build systems and compilers. This can be achieved as follows:

cd <project root>
mkdir build
cd build

cmake -G <generator> <configuration options> ../
cmake --build ../
ctest

The following configuration options are available:

Name Possible Values Description Default Value
BUILD_TESTING ON, OFF Build the test suite ON
ENABLE_SANITIZERS ON, OFF Build the tests with sanitizers enabled OFF
Catch2_ROOT <path> Path to a Catch2 installation undefined

Installing Via CMake

cd <project root>
mkdir build
cd build

cmake -G <generator> <configuration options> -DCMAKE_INSTALL_PREFIX=<install dir> ../
cmake --install ../

License

The MIT License

Copyright (c) 2017 Jonathan B. Coe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A const-propagating member-pointer-wrapper for the C++ standard library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 52.8%
  • C++ 29.8%
  • CMake 9.3%
  • Python 7.2%
  • Other 0.9%