Naios / continuable

C++14 asynchronous allocation aware futures (supporting then, exception handling, coroutines and connections)
https://naios.github.io/continuable/
MIT License
815 stars 44 forks source link

Issue fix : compile time error on calling when_seq #45

Closed sTabishAzam closed 2 years ago

sTabishAzam commented 2 years ago

Fix to the issue https://github.com/Naios/continuable/issues/34

This was causing error on usage of when seq :: "result is not a type name static or enumerator"

@Naios


What was a problem?

upon using when_seq on MSVC , an error was thrown stating "result is not a type name static or enumerator". This was because "result" was an ambiguous identifier. The solution of this problem was to rename result to a different identifier used in the lambda (as also seen in connection-all.cpp)

How this PR fixes the problem?

This PR changes the identifier name "result" being used inside connection_finalizer to "res", which then is non ambiguous with proxy_continuable's result.

Check lists (check x in [ ] of list items)

Additional Comments (if any)

{Please write here}

Naios commented 2 years ago

Thank you for your contribution. Are you using MSVC 2022 or on which MSVC version did this issue occur? It probably fails to disambiguate between the variable result and the cti::result class.

sTabishAzam commented 2 years ago

Thank you for your contribution. Are you using MSVC 2022 or on which MSVC version did this issue occur? It probably fails to disambiguate between the variable result and the cti::result class.

I am currently on MSVC 19 but this problem has persisted even before I believe; you are right this should be looked in depth. However, the fix I provided does make the when_seq tag workable. Hence allowing to use full potential if the library

Naios commented 2 years ago

I merged it, thank you for your contribution.