This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| // Reference example of the pattern | |
| // See: https://medium.com/@felixolivierdumas/exotic-crtp-rethinking-static-polymorphism-with-c-23-89f9e75e8ffd | |
| #pragma once | |
| #include <iostream> | |
| #include <type_traits> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| #pragma once | |
| #include <cstddef> | |
| #include <atomic> | |
| #include <stdexcept> | |
| namespace exotic::memory { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| #pragma once | |
| // This is my own custom memory_resource, but you can either use your own | |
| // or the one from the standard library (std::pmr). | |
| #include "memory_resource.hpp" | |
| #include <cstddef> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) May 2026 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| #pragma once | |
| #include <cstddef> | |
| #include <tuple> | |
| #include <utility> | |
| #include <type_traits> | |
| #include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /********************************************************************* | |
| * EXOTIC.lyst - Header-only C++ typelist library | |
| * | |
| * Copyright (c) 2026 Félix-Olivier Dumas | |
| * All rights reserved. | |
| * | |
| * Licensed under the Boost Software License, Version 1.0. | |
| * You may obtain a copy of the License at: | |
| * https://www.boost.org/LICENSE_1_0.txt | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /********************************************************************* | |
| * EXOTIC.lynx - Header-only C++ compile-time pipeline library | |
| * | |
| * Copyright (c) 2026 Félix-Olivier Dumas | |
| * All rights reserved. | |
| * | |
| * Licensed under the Boost Software License, Version 1.0. | |
| * You may obtain a copy of the License at: | |
| * https://www.boost.org/LICENSE_1_0.txt | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) December 2025 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| #include <iostream> | |
| struct Point { | |
| int x, y; | |
| Point(int a, int b) : x(a), y(b) {} | |
| void print() { std::cout << "(" << x << "," << y << ")\n"; } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) December 2025 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| template<typename Derived> | |
| struct Singleton { | |
| public: | |
| static Derived& instance() { | |
| static Derived instance(Token{}); | |
| return instance; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) December 2025 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| template<typename Hooked> | |
| struct IEventHookable { | |
| protected: | |
| IEventHookable() { | |
| if constexpr (requires(Hooked h) { h.onCreated(); }) | |
| static_cast<Hooked*>(this)->onCreated(); | |
| else onCreatedDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) December 2025 Félix-Olivier Dumas. All rights reserved. | |
| // Licensed under the terms described in the LICENSE file | |
| template<typename Variation> | |
| class IPrinter { | |
| public: | |
| template<typename... Args> | |
| auto print(Args&&... args) noexcept -> | |
| std::enable_if_t<std::is_void_v | |
| <decltype(std::declval<Variation>().print(std::declval<Args>()...))>, |
NewerOlder