https://godbolt.org/z/cXp7_K Here is a drawback (and I fixed the string parser code a bit). If you want to "specialize" something that is already matched, it's ambiguous and fails to compile. Does anybody know how to disambiguate it?
Even with #cplusplus concepts, we don't have partial template function specialization, but you can get pretty close with is_same_v<T, SpecializedType>.
https://godbolt.org/z/H0Qbz6
(Disclaimer, I haven't run the code -- only toying around in Godbolt.)
-
-
Näytä tämä ketju
-
https://godbolt.org/z/gIY5Q5 Alright, so if you create a Concept for your exact type, **and** that concept contains the other matching concept, it will get disambiguated. Better would be for partial template function specialization to exist and to always have matching preference.
Näytä tämä ketju
Keskustelun loppu
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.