Closed SimonEbner closed 6 years ago
Compiling the following program works for T=std::vector but not for T=std::vector<std::string>
T=std::vector
T=std::vector<std::string>
#include <type_traits> #include "di.hpp" namespace di = boost::di; using T = std::vector<std::string>; template<typename Impl=class Interface> struct X{ X(Impl& x) { static_assert(std::is_same<Impl, T>::value, "E"); } }; int main() { di::make_injector( di::bind<Interface>.to<T>() ).create<X>(); }
Program compiles without errors for using T = std::string and using T = std::vector<std::string>
using T = std::string
using T = std::vector<std::string>
Program compiles without errors for T=std::string but produces many errors for T = std::vector<std::string>, starting with the following error
T=std::string
T = std::vector<std::string>
di.hpp:358:3: error: static assertion failed: constraint not satisfied static_assert(T::value, "constraint not satisfied");
The full log is attached. err.txt
Compiling the following program works for
T=std::vector
but not forT=std::vector<std::string>
Expected Behavior
Program compiles without errors for
using T = std::string
andusing T = std::vector<std::string>
Actual Behavior
Program compiles without errors for
T=std::string
but produces many errors forT = std::vector<std::string>
, starting with the following errorThe full log is attached. err.txt
Specifications