I'm trying to do something like:
#pragma once
#include <memory>
#include <type_traits>
#include <vector>
class B{}
template <class T>
class A
{
private:
std::vector<std::shared_ptr<T>> ptrVector;
public:
A<T>();
void pushBack(std::shared_ptr<T> t);
if(std::is_same<T, B>::value)
{
void doSth();
}
~A<T>(){};
};
is it even possible to do a condition like this, somehow?
No, I can't inherit from this class, and need doSth() ONLY if A<B>
, the doSth() should not exist if A<C>
.