मैं सिर्फ नवीनतम जो जीसीसी 7.1.1 शामिल करने के लिए अपने कट्टर Linux सिस्टम अद्यतन के साथ
clang++ main.cpp -std=c++1z
परिणामों का उपयोग
#include <functional>
int main(int argc, char** argv) {
return 1;
}
: इस का निर्माण करने की कोशिश कर रहा
In file included from main.cpp:1:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/functional:60:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/unordered_map:47:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/hashtable.h:37:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/bits/node_handle.h:39:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:27: error: use of class template 'optional'
requires template arguments
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:451:11: note: template is declared here
class optional
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:40: error: expected ';' at end of declaration
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.1.1/../../../../include/c++/7.1.1/optional:1032:41: error: cannot use arrow operator on a type
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
इस बजना मेरी ओर से एक त्रुटि, मेहराब लिनक्स, या है?
अद्यतन:
- जीसीसी पैकेज संस्करण 7.1.1-2 (प्रदान करता है/usr/शामिल/C++ dir)
- बजना पैकेज संस्करण (संस्करण जोड़ने के लिए भूल गया) 4.0.0-3
बजना बस कटौती अभी तक गाइड का समर्थन नहीं करता तरह लग रहा है। – Barry
आह, मुझे एहसास नहीं हुआ कि यह क्या हो रहा था (और सी ++ 17 की सुविधा के रूप में इसके बारे में भूल गया)। धन्यवाद! – ryan0270
वही त्रुटि यहाँ। क्या आपको कोई कामकाज मिला? मुझे मिला एकमात्र जी ++ पर स्विच करना था .. –