You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, I don't know the type of the resulting strong lambdas until after they are mixed-in. This mix-in is defined in the .cpp file and is not available in a header file. In order to get around this limitation I would like to use a concept to limit the type of functor that can be passed into a class or function defined in a separate header file.
If I use a specific phantom tag it seems like this should allow me to write a concept that is limited to strong lambdas that use the same phantom tag type.
I think it should be as simple as adding the line using TagType = Parameter; to the NamedType implementation.
I can then write a concept that is restricted to that TagType
I was looking at the feasibility of using NamedType to create some strong lambdas.
See Strong lambdas: strong typing over generic types
Unfortunately, I don't know the type of the resulting strong lambdas until after they are mixed-in. This mix-in is defined in the .cpp file and is not available in a header file. In order to get around this limitation I would like to use a concept to limit the type of functor that can be passed into a class or function defined in a separate header file.
If I use a specific phantom tag it seems like this should allow me to write a concept that is limited to strong lambdas that use the same phantom tag type.
I think it should be as simple as adding the line
using TagType = Parameter;
to the NamedType implementation.I can then write a concept that is restricted to that TagType
I have an example on godbolt.org
The text was updated successfully, but these errors were encountered: