1
0
mirror of synced 2024-12-15 17:21:16 +01:00
ImHex/lib/libimhex/include/hex/helpers/concepts.hpp

23 lines
426 B
C++
Raw Normal View History

2021-08-29 22:15:18 +02:00
#pragma once
#include <type_traits>
#include <memory>
2021-08-29 22:15:18 +02:00
#include <concepts>
2021-08-29 22:15:18 +02:00
2021-08-30 19:12:19 +02:00
namespace hex {
template<typename T>
struct always_false : std::false_type { };
2021-08-30 19:12:19 +02:00
template<typename T, size_t Size>
concept has_size = sizeof(T) == Size;
template<typename T>
2023-04-18 10:06:47 +02:00
class ICloneable {
public:
2023-11-10 20:47:08 +01:00
virtual ~ICloneable() = default;
[[nodiscard]] virtual std::unique_ptr<T> clone() const = 0;
};
}