पर विचार करता है:हटाए निर्माता - MSVC एक त्रुटि रिपोर्ट करती है, बजना निम्न कोड नहीं
1>consoleapplication2.cpp(13): error C2280: 'SILPassPipelinePlan::SILPassPipelinePlan(SILPassPipelinePlan &&)': attempting to reference a deleted function
1>consoleapplication2.cpp(8): note: see declaration of 'SILPassPipelinePlan::SILPassPipelinePlan'
बजना और जीसीसी नहीं है:
class SILPassPipelinePlan final {
public:
SILPassPipelinePlan() = default;
~SILPassPipelinePlan() = default;
SILPassPipelinePlan(const SILPassPipelinePlan &) = default;
SILPassPipelinePlan(SILPassPipelinePlan &&) = delete;
SILPassPipelinePlan x() {
SILPassPipelinePlan P;
return P;
}
};
int main() {
return 0;
}
MSVC निम्न त्रुटि की रिपोर्ट।
एक विनिर्देश बिंदु से, कौन सा संकलक सही है? क्या यह एक एमएसवीसी बग है, या क्लैंग बग है?
एमएसवीसी नवीनतम विजुअल स्टूडियो 2015 अपडेट 3 से है, क्लैंग संस्करण 3.9.0 है।
जो क्लैंग और जीसीसी से आप '-std' ध्वज गुजर रहे हैं? कन्स्ट्रक्टर हटाने को ले जाएं C++ 11 और C++ 14 के बीच महत्वपूर्ण परिवर्तन हुए हैं। – Angew
@Angew कोई विशिष्ट झंडे। इसे यहां आज़माएं: http://rextester.com/WJMW74714 –
उस रेक्स्टेस्टर लिंक के आधार पर, आप '-std = C++ 14' का उपयोग कर रहे हैं। आपको इस जानकारी को प्रश्न में जोड़ना चाहिए। – Angew