I have been using SFINAE-based approaches for quite some time, especially to enable/disable specific class template specializations via std::enable_if.
I was thus a bit puzzled while reading the paper describing the proposed void_t alias / detection idiom:
Section 4 is devoted to the discussion of the validity of the idiom, and refers to a discussion in which two parties argue about the applicability of SFINAE in partial class template specializations (with Richard Smith pointing out that the standard is lacking wording about this topic). Towards the end of the section, the following CWG issue is mentioned
Here again it is stated that the standard does not explicitly allows the example reproduced in the issue.
I am a bit baffled because it seems to me that, e.g., the usage of enable_if in partial specializations has been standard practice for quite some time (see for instance the Boost documentation, which explicitly mentions partial specializations).
Am I misunderstanding the points in the documents above or is this really a grey area?
Aucun commentaire:
Enregistrer un commentaire