読者です 読者をやめる 読者になる 読者になる

VC++10 CTPでautoを遊んでみた

VC++
int n = 0;
auto a = n; // int a = n;
int n = 0;
auto* a = &n; // int* a = &n;
int n = 0;
const auto& a = n; // const int& a = n;
struct hoge {
};

hoge foo() { return hoge(); }

auto&& h = foo(); // hoge&& h = foo();
auto* p = new auto(1); // int* p = new int(1);
#include <typeinfo>
#include <iostream>
#include <functional>

using namespace std;
using namespace std::tr1;
using namespace std::tr1::placeholders;

void foo(int x, int y) {}

int main()
{
    auto f = bind(bind(foo, _1, 2), 3);

    cout << typeid(f).name() << endl;
}
class std::tr1::_Bind<struct std::tr1::_Notforced,class std::tr1::_Bind1<struct std::tr1::_Callable_obj<class std::tr1::_Bind<struct std::tr1::_Notforced,class std::tr1::_Bind2<struct std::tr1::_Callable_fun<void (__cdecl*const)(int,int),0>,class std::tr1::_Ph<1>,int> >,0>,int> >