3 ms·
My original post: Private constructors still match for overload resolution, and can cause your compiler to barf when a explicit deletion would allow the compile
by Taywee 5y ago
My original post: Private constructors still match for overload resolution, and can cause your compiler to barf when a explicit deletion would allow the compiler to find an appropriate legal match.
I was wrong. delete leaves it in the overload set. I've been using C++ for a decade and I'm still tripping over some of the stupider semantics.
- quietbritishjim 5y agoYou edited before I got the chance to make a snarky reply :-) For the record, the following snippet will not compile because the deleted constructor will be matched during overload resolution. class C { public: C(int) = delete; C(long) {} }; int main() { C x(3); }