2016-06-01から1ヶ月間の記事一覧

(皆さんご周知の事ではありますが、偶には思い出すべきです故にあえて言いますが)VC6は糞

C++

#include <iostream> template<typename T> class A { public: A() { std::cout << "A()" << std::endl; } A(const A<T>& t) { std::cout << "A<T>()" << std::endl; } template<typename U> A(const A<U>& u) { std::cout << "A<U>()" << std::endl; } }; int main() { A<int> int1; A<int> int2(int1); A<long> long_(int…</long></int></int></u></u></typename></t></t></typename></iostream>

PathQuoteSpaces() の戻り値の型がモノによって異なっていて死亡

// VC6 LWSTDAPI_(void) PathQuoteSpacesA(LPSTR lpsz); LWSTDAPI_(void) PathQuoteSpacesW(LPWSTR lpsz); // VC2003 LWSTDAPI_(void) PathQuoteSpacesA(LPSTR lpsz); LWSTDAPI_(void) PathQuoteSpacesW(LPWSTR lpsz); // VC2005 LWSTDAPI_(void) PathQuoteS…

if() のカッコ内で変数定義出来なくて死亡

C++

struct A { A(){} A(int dummy){} operator bool () const { return true; } }; if(int n = 1) { // 当然OK } if(A a(1)) { // C2059 } if(A a) { // C2059 } if(A a = A(1)) { // OK } へー…真ん中もOKになりませんかね(ぉ