Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS 2015 compilation issue #49

Closed
kanstantsin-chernik opened this issue May 24, 2017 · 5 comments
Closed

VS 2015 compilation issue #49

kanstantsin-chernik opened this issue May 24, 2017 · 5 comments

Comments

@kanstantsin-chernik
Copy link

Hello,

As I understood from closed issues is that VS 2015 Update 3 is supported with fruit, isn't it?
I was just download repository, generated debug 32 project and pressed build~
After this I received quite a lot of issues related to one file injector.defn.h:

Error C2061 syntax error: identifier 'RemoveAnnotations<`template-type-parameter-1'>' fixed_size_vector-exec fruit-master\include\fruit\impl\injector.defn.h 99

Could you help me to understand what I am doing wrong?
Thank you for your time!

@poletti-marco
Copy link
Contributor

poletti-marco commented May 24, 2017 via email

@kanstantsin-chernik
Copy link
Author

Thank you for answer!
It is ok. We are on our way in moving source base to VS17.

I've looked at wiki/install and found that VS isn't supported.
Then I've opened issue issue 9 where I got that VS2017 is supported for sure. It means that wiki page is out dated. Actually, you've posted 2 messages, first that you are not going to add 2015 support and second that is was easier than expected with no version mentioned and closed issue. I just made a wrong assumption.
BTW, then I got through appveyor jobs and realized that 2015 isn't supported but already posted this issue :)

Thank you for nice solution. I am going to integrate it till the end of summer.

@poletti-marco
Copy link
Contributor

poletti-marco commented May 24, 2017 via email

@Paxxi
Copy link

Paxxi commented Jul 28, 2017

I'm still on VS2015 for the foreseeable future so I decided to look into the error. The following changes solves the compile issue

diff --git a/include/fruit/component.h b/include/fruit/component.h
index 6ca41e8..1081403 100644
--- a/include/fruit/component.h
+++ b/include/fruit/component.h
@@ -649,9 +649,9 @@ public:
    * other components.
    */
   template <typename OtherComponent, typename... Args>
-  PartialComponentWithReplacementInProgress<OtherComponent, Args...> replace(
+  auto replace(
       OtherComponent(*)(Args...),
-      Args... args);
+      Args... args) -> auto;

   ~PartialComponent();

diff --git a/include/fruit/impl/component.defn.h b/include/fruit/impl/component.defn.h
index b3303ef..ce55024 100644
--- a/include/fruit/impl/component.defn.h
+++ b/include/fruit/impl/component.defn.h
@@ -260,8 +260,8 @@ PartialComponent<Bindings...>::install(OtherComponent(*fun)(Args...), Args... ar

 template <typename... Bindings>
 template <typename OtherComponent, typename... ReplacedFunArgs>
-inline PartialComponent<Bindings...>::PartialComponentWithReplacementInProgress<OtherComponent, ReplacedFunArgs...>
-PartialComponent<Bindings...>::replace(OtherComponent(*fun)(ReplacedFunArgs...), ReplacedFunArgs... args) {
+inline auto
+PartialComponent<Bindings...>::replace(OtherComponent(*fun)(ReplacedFunArgs...), ReplacedFunArgs... args) -> auto {
   using IntCollector = int[];
   (void)(IntCollector{0, checkAcceptableComponentInstallArg<ReplacedFunArgs>()...});

@poletti-marco
Copy link
Contributor

I gave that patch a try, but it doesn't seem to be enough.
After playing around with it a bit more, with additional changes I was able to get Fruit to compile under MSVC 2015, but when running the tests I got some runtime crashes (that don't occur with other compilers nor with MSVC 2017). So I'm afraid I'm unable to support Fruit under MSVC 2015 for the time being.
If you're curious and/or you have time to look into it, I've committed my patch as 8d00ef4 (in a separate msvc-2015 branch, not in master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants