ftz.Lyberta.net

Modern C++ goodness

ftz General

General purpose C++ algorithm and class library

This library is where all useful bits of general purpose code end up in. As a result, it is used as a foundation for most of my projects.

Key features

  • Cross platform - written in ISO C++17 + Concepts TS + Library Fundamentals 2 TS (+ #pragma once).
  • Highly generic code - where possible, templates are used instead of fixed types.
  • Free software - released under the terms of GNU GPLv3 or any later version.

Dependencies

Compiler support

  • G++ 8 or newer with libstdc++

How to get

You need to use Conan to install and use this library. To install Conan on APT-based distros you would typically do:

# apt install python-pip
$ pip install conan

Then add official ftz repository:

$ conan remote add ftz https://conan.ftz.lyberta.net

Then you need to follow a Conan tutorial to declare that your project depends on this library, for example, using conanfile.txt:

[requires]
ftzGeneral/Latest@Lyberta/Latest

Or using conanfile.py:

build_requires = "ftzGeneral/Latest@Lyberta/Latest"

The rest depends on your build system. In CMake you would do:

# Importing Conan settings.
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

# Adding example executable target.
add_executable(Example ...)

# Specifying libraries to link executable to.
target_link_libraries(Example PRIVATE CONAN_PKG::ftzGeneral)

After that in your source code you include files like this:

#include <ftz/General/SomeHeader.h>

To build your code, remember to execute conan install before calling conan build or cmake so your dependencies will be set correctly.

Source code

API reference

Manually building the library

Build dependencies:

  • Git
  • G++ 8 or newer
  • CMake 3.8 or newer
  • Conan 1.2 or newer

To install dependencies on Debian Testing you would invoke:

# apt install git g++-8 cmake python-pip
$ pip install conan

If you didn’t have Conan installed before, you probably need to configure the default profile:

$ conan profile new --detect default
$ conan profile update settings.compiler.version=8 default
$ conan profile update settings.compiler.libcxx=libstdc++11 default
$ conan profile update settings.cppstd=17 default

Add official ftz repository to Conan:

$ conan remote add ftz https://conan.ftz.lyberta.net

Clone the repository and switch into it:

$ git clone https://gitlab.com/ftz/general.git
$ cd general

Build the Conan package with your specified user and channel:

$ conan create . User/Channel