GCC 4.5 の半分は C++03 へのやさしさでできています

When printing the name of a class template specialization, G++ will now omit any template arguments which match the default template argument for that parameter. This behavior (and the pretty-printing of function template specializations as template signature and arguments) can be disabled with the -fno-pretty-templates option.

http://gcc.gnu.org/gcc-4.5/changes.html

この文章を読んで衝撃を受ける奴はよく訓練された C++er だ.ホント, C++ は地獄だぜ! フゥハハハーハァー!

#include <string>
#include <map>

int main()
{
  std::map<std::string, std::string> m = 1;
}

GCC 4.5 で -fno-pretty-templates オプションを付けたときのコンパイルエラー. (従来の g++ と同じ挙動)

test.cpp: In function ‘int main()’:
test.cpp:6:42: error: conversion from ‘int’ to non-scalar type ‘std::map, std::allocator >, std::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator >, std::basic_string, std::allocator > > > >’ requested

GCC 4.5 のデフォルトのコンパイルエラー.

test.cpp: In function ‘int main()’:
test.cpp:6:42: error: conversion from ‘int’ to non-scalar type ‘std::map, std::basic_string >’ requested

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy