++Phobos

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Oct 17 00:36:09 UTC 2019


On Wednesday, 16 October 2019 at 22:34:00 UTC, rikki cattermole 
wrote:
>
> /// Docs go here
> signature InputRange(@named ElementType) {
> 	@property {
> 		/// Docs go here
> 		ElementType front();
>
> 		/// Docs go here
> 		bool empty();
> 	}
>
> 	/// Docs go here
> 	void popFront();
> }
>
> void func(T:InputRange)(T myInputRange) {}
>


The experimental.typecons has an incomplete modification to wrap. 
It allows wrapping a structure into an interface if it conforms. 
If the edge cases were worked out then similar logic would be 
applicable to the function signature.

...) if(implements!(InputRange, R))

What would be nice from the language is the ability to print a 
message if no template matching occurs. Remember if it does not 
match it is just pulled from overload resolution.


More information about the Digitalmars-d mailing list