C++N4910コンパイル実験で、
ソースコードの部品のコンパイル試験を実施していて、
PDFから持って来る時に開業が抜けて、コメントの後ろについたままのことがある。
C++で一番困るのが、template。
よく考えたら、grepすればわかるじゃん。
bash
# grep template p706.cpp
template<class T, class... Args> constexpr T& emplace(Args&&... args);
template<class T, class U, class... Args>
// where I is the zero-based index of T in Types. template<size_t I, class... Args>
template<size_t I, class U, class... Args>
コメント行にtemplateの文字列があったら、説明文か実行分かを判定すればよい。
特に、今回の作業では、実行可能な説明文はコンパイルするようにしている。