dememax: (Hacker Emblem)
[personal profile] dememax
Что-то я пропустил "новость": у Си++ есть теперь свой Вики - http://cppreference.com/
Ну, не сразу, ну, уже давно, ну, ...
Короче, если интересна история сайта:
CppCon 2014: Nate Kohl "cppreference.com: documenting C++ one edit at a time"

В видео есть слайд с одним из победителей "The Grand C++ Error Explosion Competition", категория "Most surprising":
template<class T>class L{L<T*>operator->()};L<int>i=i->
Запустил у себя с gcc 6.2, действительно, поразительный эффект: я устал ждать, очень долго работал компилятор и генерил без остановки вывод:
a.cpp:1:42: error: expected ‘;’ at end of member declaration
template<class T>class L{L<T*>operator->()};L<int>i=i->
^
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp: In instantiation of ‘L<T*> L<T>::operator->() [with T = int]’:
a.cpp:1:54: required from here
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int*]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int**]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int***]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int****]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int*****]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int******]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~
a.cpp:1:31: note: declared private here
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~~~~~~~
a.cpp:1:54: error: ‘L<T*> L<T>::operator->() [with T = int*******]’ is private within this context
template<class T>class L{L<T*>operator->()};L<int>i=i->
^~

Date: 2016-09-20 06:07 am (UTC)
From: [identity profile] madf.livejournal.com
Надо же, не думал что есть еще кто-то из C++-ников кто не знает про существование cppreference.com

Profile

dememax

May 2023

S M T W T F S
 123456
78910111213
14151617181920
21 2223 24252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 20th, 2025 10:12 am
Powered by Dreamwidth Studios