Esempio n. 1
0
decltype(auto) multi1e = multi1a, multi1f = multi1b; // expected-error {{'decltype(auto)' deduced as 'int' in declaration of 'multi1e' and deduced as 'int &' in declaration of 'multi1f'}}

auto f1a() { return 0; }
decltype(auto) f1d() { return 0; }
using Int = decltype(f1a());
using Int = decltype(f1d());

auto f2a(int n) { return n; }
decltype(auto) f2d(int n) { return n; }
using Int = decltype(f2a(0));
using Int = decltype(f2d(0));

auto f3a(int n) { return (n); }
decltype(auto) f3d(int n) { return (n); } // expected-warning {{reference to stack memory}}
using Int = decltype(f3a(0));
using IntLRef = decltype(f3d(0));

auto f4a(int n) { return f(); }
decltype(auto) f4d(int n) { return f(); }
using Int = decltype(f4a(0));
using IntRRef = decltype(f4d(0));

auto f5aa(int n) { auto x = f(); return x; }
auto f5ad(int n) { decltype(auto) x = f(); return x; }
decltype(auto) f5da(int n) { auto x = f(); return x; }
decltype(auto) f5dd(int n) { decltype(auto) x = f(); return x; } // expected-error {{rvalue reference to type 'int' cannot bind to lvalue}}
using Int = decltype(f5aa(0));
using Int = decltype(f5ad(0));
using Int = decltype(f5da(0));

auto init_list_1() { return { 1, 2, 3 }; } // expected-error {{cannot deduce return type from initializer list}}
Esempio n. 2
0
// -----------------------------------------------------------------
// Name : goToGround
// -----------------------------------------------------------------
void Character::goToGround(double x, double y)
{
	bHasMoveTarget = true;
	moveTarget = f3d(x, y, BOARDPLANE);
}
Esempio n. 3
0
f3d sqrt(const f3d &d3) {
	return f3d(sqrt(d3.x), sqrt(d3.y), sqrt(d3.z));
}
Esempio n. 4
0
f3d atan(const f3d &d3) {
	return f3d(atan(d3.x), atan(d3.y), atan(d3.z));
}
Esempio n. 5
0
f3d tan(const f3d &d3) {
	return f3d(tan(d3.x), tan(d3.y), tan(d3.z));
}
Esempio n. 6
0
f3d cos(const f3d &d3) {
	return f3d(cos(d3.x), cos(d3.y), cos(d3.z));
}
Esempio n. 7
0
f3d sin(const f3d &d3) {
	return f3d(sin(d3.x), sin(d3.y), sin(d3.z));
}