[LAD] [semi-OT} c++20 concepts and syntax

"Jeanette C." <julien-3g/[email protected]>
Newsgroups gmane.linux.audio.devel
Message-ID <[email protected]>
Hey hey,
figuring out the syntax for c++20 concepts I run into challenges. With a two 
parameter template concept like swappable_with or convertible_to is it always 
necessary to use a requires statement like this:
template<typename T>
requires std::convertible_to<T,int>
void f(T t) ...
...

With single parameter concepts like integral a syntax like this will work:
template<std::integral T>
void f(T t)...

Also with single parameter concepts a statement like this should work:
std::integral auto my_variable;
Will that work with a two parameter concept like the above convertible_to? I 
haven't seen/found a syntax which does it.

Any help is appreciated, definitely including a good read that WILL 
demonstrate or demystify these things.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Don't care about money
It doesn't give me half the thrill <3
(Britney Spears)
_______________________________________________
Linux-audio-dev mailing list -- linux-audio-dev-cunTk1MwBs/[email protected]
To unsubscribe send an email to linux-audio-dev-leave-cunTk1MwBs/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.