13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>• A call of a dependent function template without the use of the template keyword is accepted if anormal lookup in the scope of the reference finds a function template or an overload set containing afunction template (even though that function template will not end up being the one that is actuallycalled).template struct A {template void f(U);};template struct B {template void f(U);void f(){}A a;void g(T t) {a.f(t); // accepted in g++ mode - should be written as:// m_impl.f template (t)}};• The template keyword may be omitted in a dependent member class template reference when thetemplate argument list matches the implied template argument list of the prototype instantiation. In theexample below, in the reference to A::B the template parameter T has the same coordinates(position and nesting depth) as the T of the prototype instantiation of A, so the template keyword canbe omitted.template struct A {template struct B {};};template struct C {A::B ab1; // g++ acceptsA::B ab2; // g++ acceptsA::B ab3; // g++ gives errortypename A::template B ab4; // correct syntax};• Partial ordering in non-call contexts does not include the return type in the partial ordering process.template T f(const T* p);template int f(T* p);// ambiguous specialization, but accepted in g++ modetemplate int f(const int*){return 0;}• A pointer to function is considered to be compatible with a reference to function <strong>for</strong> partial orderingpurposes (gnu_version 40100 and above).template void f(T** p, void (*)()); // #1template void f(T* p, void (&)()); // #2void x(){}void g(int** p) {60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!