Introduction

cpptools is C++ library

cookiecutter.project_name provides:

  • an API following the idioms of the C++ standard library.

Licensing

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.

Installation

Although cpptools is a header-only library, we provide standardized means to install it, with package managers or with cmake.

Besides the cpptools headers, all these methods place the cmake project configuration file in the right location so that third-party projects can use cmake’s find_package to locate xtensor headers.

From source with cmake

You can also install cpptools from source with cmake. On Unix platforms, from the source directory:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
make install

On Windows platforms, from the source directory:

mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
nmake
nmake install

See the section of the documentation on build-options, for more details on how to cmake options.

Changelog

0.1.0

  • inital version

Basic usage

Initialize a 2-D array and compute the sum of one of its rows and a 1-D array.

#include "cpptools/cpptools.hpp"

Examples

The hello world of cpptools

1
2
3
4
5
6
#include "cpptools/cpptools.hpp"
#include "cpptools/cpptools_config.hpp"

int main(int argc, char *argv[]){

}

Print the versions of cpptools

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#include <iostream>

#include "cpptools/cpptools.hpp"
#include "cpptools/cpptools_config.hpp"

int main(int argc, char *argv[]){
    std::cout<<"CPPTOOLS_VERSION_MAJOR "<<CPPTOOLS_VERSION_MAJOR<<"\n";
    std::cout<<"CPPTOOLS_VERSION_MINOR "<<CPPTOOLS_VERSION_MINOR<<"\n";
    std::cout<<"CPPTOOLS_VERSION_PATCH "<<CPPTOOLS_VERSION_PATCH<<"\n";
}

Compiler workarounds

This page tracks the workarounds for the various compiler issues that we encountered in the development. This is mostly of interest for developers interested in contributing to cpptools.