Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #7737
| From | "Bo Persson" <bop@gmb.dk> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: what may cause compile error (expected nested-name-specifier before 'Policy-T')? |
| Date | 2011-07-11 22:42 +0200 |
| Message-ID | <9815h1F7tlU1@mid.individual.net> (permalink) |
| References | <64a52045-54be-4994-a805-72aab256b2b2@j14g2000prn.googlegroups.com> |
eric wrote:
> Dear advanced c/g++ programers:
>
> I tried to test a piece code about Defining constrained Value
> Types
> --------------------------------------------------------------------------------------------------------
> // Example 5-10 constrained_value.hpp
> #ifndef CINSTRAINED_VALUE_HPP
> #define CONSTRAINED_VALUE_HPP
>
> #include <cstdlib>
> #include <iostream>
>
> using namespace std;
>
> template<class Policy_T>
> struct ConstrainedValue
> {
> public:
> // public typedefs
> typedef typename Policy_T policy_type;
Here "typename" is not required, so it is not allowed. Hard rules!
> typedef typename Policy_T::value_type value_type;
Here "typename" indicates that the nested name is a type, so it is
required.
Bo Persson
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
what may cause compile error (expected nested-name-specifier before 'Policy-T')? eric <cneric12lin0@gmail.com> - 2011-07-11 11:59 -0700 Re: what may cause compile error (expected nested-name-specifier before 'Policy-T')? "Bo Persson" <bop@gmb.dk> - 2011-07-11 22:42 +0200 Re: what may cause compile error (expected nested-name-specifier before 'Policy-T')? Qi <no@no.no> - 2011-07-12 10:14 +0800
csiph-web