Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - template parameter non-type deduction
Can't find a directly relevant section on this other than 14.8.2.4, but that seems restricted to function templates. This is used in a low level boost lib. #include <cstddef> template <typename T> struct A { }; template <typename T, std::size_t N> struct A<T [N]> { }; void main() { std::size_t bound = 3; typedef int B[bound]; A<B> a; // Error: template-argument 'N' has no value // in template function specialization } The standard is pretty clear on this for function argument deduction (that array type and array size may be deduced from well formed array syntax), but iffy on class template parameter deduction, and other resources seem undecided. But a code fragement like this probably works for VC++, Borland, etc (as in their are no preprocessor exclusions based on compiler type). In any case, DM is unable to produce an explicit definition that is based on a deduced non-type parameter. Any one have some previous dealings with something like this? Richard Jan 12 2003
|