boost-ext / di

C++14 Dependency Injection Library
https://boost-ext.github.io/di
1.14k stars 138 forks source link

Multiple issues with VS 16.5.3 msvc compiler version is 19.25.28612 #462

Open kanstantsin-chernik opened 4 years ago

kanstantsin-chernik commented 4 years ago

Expected Behavior

Build and run tests

Actual Behavior

Build fails

Steps to Reproduce the Problem

  1. Install VS 16.5.3 (compiler msvc 19.25.28612)
  2. Run build

Specifications

cstamatopoulos commented 4 years ago

I am also having build issues in 16.5.4. Are there any known workarounds?

krzysztof-jusiak commented 4 years ago

Almost there with https://github.com/boost-experimental/di/pull/465

kanstantsin-chernik commented 4 years ago

@cstamatopoulos It is likely VS fails to deduct the type from injector. You can just evaluate all lambdas with injector in your project and define the output type explicitly like here. Also, you need to grab latest sources from #465 to fix factories if you use them

cstamatopoulos commented 4 years ago

That is correct.

I also wanted to mention that in the latest version of VS at least, the code below works fine template <int... Ns> index_sequence<Ns...> from_std(std::integer_sequence<int, Ns...>) { return {}; } template <int N> using make_index_sequence = decltype(from_std(std::make_integer_sequence<int, N>{}));

I had a ctor with 11 controllers, and thought of giving it a try to avoid manually adding additional make_index_sequence_impl and all seems well. Maybe you want to change the #if to #if defined(__cpp_lib_integer_sequence) && (defined(__GNUC__) || defined(__MSVC__))