Skip to content

Releases: makiolo/design-patterns-cpp14

Release list

Release 1.0.25

Choose a tag to compare

@github-actions github-actions released this 25 Jan 22:55

design-patterns-cpp14 v1.0.25

Header-only C++14 Design Patterns Library

This release includes the Factory and Memoize design patterns implementation.

Using This Release with Conan

Two easy ways to consume this package:

Option 1: Direct from Git Repository (Recommended)

Conan can directly consume recipes from git repositories! Add this to your conanfile.txt:

[requires]
design-patterns-cpp14/1.0.25@

[generators]
CMakeDeps
CMakeToolchain

Then run:

mkdir build && cd build
conan install .. \
  --build=missing
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
cmake --build .

Or from your conanfile.py:

from conan import ConanFile

class MyProject(ConanFile):
    requires = "design-patterns-cpp14/1.0.25@"
    generators = "CMakeDeps", "CMakeToolchain"

Option 2: Clone and Use Locally

git clone https://github.com/makiolo/design-patterns-cpp14.git
cd design-patterns-cpp14
git checkout v1.0.25

# In your project's conanfile.txt:
[requires]
design-patterns-cpp14/path/to/design-patterns-cpp14

What's Included

  • Header-only library - No compilation needed
  • Factory Pattern - Dynamic object creation and registration
  • Memoize Pattern - Object caching and pooling
  • Zero dependencies - Only C++ standard library (C++14+)
  • Cross-platform - Works on Linux, macOS, Windows

Compiler Support

  • GCC 4.9+
  • Clang 3.6+
  • MSVC 2015+

Complete Documentation

Quick Example

#include <dp14/factory.h>
#include <memory>

class Shape { /* ... */ };
class Circle : public Shape { /* ... */ };
class Square : public Shape { /* ... */ };

int main() {
    Shape::factory factory;
    Shape::factory::registrator<Circle> reg1(factory);
    Shape::factory::registrator<Square> reg2(factory);
    
    auto circle = factory.create<Circle>();
    auto square = factory.create<Square>();
    
    return 0;
}

Report Issues

Found a bug? Open an issue