const_container/include/CompileOptional.h

22 lines
381 B
C++

//
// Created by Patrick Maschek on 22.01.2024.
//
#ifndef CONST_CONTAINER_COMPILEOPTIONAL_H_
#define CONST_CONTAINER_COMPILEOPTIONAL_H_
namespace cc {
template<typename, bool = false>
class CompileOptional {};
template<typename T>
class CompileOptional<T, true> {
private:
T _data;
public:
operator T&() { return _data; }
};
}
#endif //UDIFF_COMPILEOPTIONAL_H_