Boost logo

Boost :

From: Dominic Gamble (dominic_at_[hidden])
Date: 2002-05-01 22:01:22


I'm a big fan of Andrei's Loki library, but I'm having trouble getting
some things to work under gcc-2.95 and gcc-3.0.

Is there a loki mailing list, or website, where I can get some help?

Is there compiler status matrix for Loki?

If not does anyone know what the status of Loki is for gcc?

In specific, a very simple example taken straight from the book "Modern
C++ Design" page 70, doesn't work:

#include <loki/HierarchyGenerators.h>
int main()
{
        typedef Loki::Tuple<TYPELIST_3(int, int, int)> Point3D;
        Point3D pt;
        Loki::Field<0>(pt) = 0;
        
        return 0;
}

compiler output:

c++ -DHAVE_CONFIG_H -I. -I. -I.. -I/home/vexil/Stratlink/Components
-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment
-Wuninitialized -Wparentheses -Wtraditional -Wpointer-arith
-Wmissing-prototypes -O1 -g -c main.cc
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h: In
instantiation of `Loki::GenScatterHierarchy<Loki::Typelist<int,
Loki::Typelist<int, Loki::NullType> >, Loki::TupleUnit>':
main.cc:9: instantiated from
`Loki::GenScatterHierarchy<Loki::Typelist<int, Loki::Typelist<int,
Loki::Typelist<int, Loki::NullType> > >, Loki::TupleUnit>'
main.cc:9: instantiated from `Loki::Tuple<Loki::Typelist<int,
Loki::Typelist<int, Loki::Typelist<int, Loki::NullType> > > >'
main.cc:9: instantiated from here
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h:56: warning:
direct
   base `Loki::GenScatterHierarchy<int, Loki::TupleUnit>' inaccessible
in
   `Loki::GenScatterHierarchy<Loki::Typelist<int, Loki::Typelist<int,
   Loki::NullType> >, Loki::TupleUnit>' due to ambiguity
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h: In
instantiation of `Loki::GenScatterHierarchy<Loki::Typelist<int,
Loki::Typelist<int, Loki::Typelist<int, Loki::NullType> > >,
Loki::TupleUnit>':
main.cc:9: instantiated from `Loki::Tuple<Loki::Typelist<int,
Loki::Typelist<int, Loki::Typelist<int, Loki::NullType> > > >'
main.cc:9: instantiated from here
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h:56: warning:
direct
   base `Loki::GenScatterHierarchy<int, Loki::TupleUnit>' inaccessible
in
   `Loki::GenScatterHierarchy<Loki::Typelist<int, Loki::Typelist<int,
   Loki::Typelist<int, Loki::NullType> > >, Loki::TupleUnit>' due to
ambiguity
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h: In static
member
   function `static typename Loki::Select<Loki::FieldHelper<H,
0>::isConst,
   typename Loki::Select<Loki::FieldHelper<H, 0>::isTuple, typename
   H::TList::Head, typename H::Rebind<typename
   H::TList::Head>::Result>::Result, typename
Loki::Select<Loki::FieldHelper<H,
   0>::isTuple, typename H::TList::Head, typename H::Rebind<typename
   H::TList::Head>::Result>::Result>::Result& Loki::FieldHelper<H,
0>::Do(H&)
   [with H = int main()::Point3D]':
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h:199:
instantiated from `typename Loki::FieldHelper<H, i>::ResultType&
Loki::Field(H&) [with int i = 0, H = int main()::Point3D]'
main.cc:10: instantiated from here
/home/vexil/Stratlink/Components/loki/HierarchyGenerators.h:150:
`Loki::GenScatterHierarchy<int,
   Loki::TupleUnit>' is an ambiguous base of
`Loki::Tuple<Loki::Typelist<int,
   Loki::Typelist<int, Loki::Typelist<int, Loki::NullType> > > >'
make[2]: *** [main.o] Error 1

Any help would be appreciated.

Regards,
Dominic Gamble


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk