Re: template depth problem
  Home FAQ Contact Sign in
comp.lang.c++.moderated only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: template depth problem         

Group: comp.lang.c++.moderated · Group Profile
Author: Dan Barbus
Date: May 9, 2008 07:43

On May 9, 6:30 am, Venkat yahoo.com> wrote:
> Trying to have the following usage; however, gcc is not liking.
>
> #include
>
> namespace xyz {
> class elem {
> public:
> typedef boost::shared_ptr elem_sptr;
>
> };
> }
>
> #include
>
> namespace abc {
> template
> class BaseContainer
> {
> typedef std::map Container;
>
> // tried this too
> //typedef std::map > Container;
>
> typedef Container::iterator iterator;
>
> Container c;
>
> };
> }
>
> void main()
> {
> abc::BaseContainer elem_container;
>
> }
>
> Any thoughts on the usage?

{ Edits: quoted sig & clc++m banner removed. Please don't quote them. -mod }

Hi,

This may not be it, I don't have time to test right now, but maybe,
the error is due to not specifying that ObjectType::elem_sptr is a
typename in the definition of BaseContainer.

That is, try this:
namespace abc {
template
class BaseContainer
{
typedef std::map Container;

Regards,
Dan

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
no comments
diggit! del.icio.us! reddit!

RELATED THREADS
SubjectArticles qty Group
has anyone used a template from Template Monster?netobjects.fusion10.webdesign ·