Boost logo

Boost :

From: jhrwalter (walter_at_[hidden])
Date: 2002-01-25 08:21:52


--- In boost_at_y <mailto:boost_at_y>..., Toon Knapen < toon.knapen_at_s
<mailto:toon.knapen_at_s>...> wrote:
> jhrwalter wrote:
>
> > --- In boost_at_y <mailto:boost_at_y>..., Toon Knapen < toon.knapen_at_s
<mailto:toon.knapen_at_s>...> wrote:
> >
> >>jhrwalter wrote:
> >>
> >>
> >>>>Basically, just use a function like this:
> >>>>
> >>>>  template<int N> ... size(Int<N>);
> >>>>
> >>>>Works in MSVC++ 6 and has neat syntax.
> >>>>
> >>>>
> >>>How do you like the idea of using free functions like
> >>>
> >>>template<class M, int N>
> >>>size_t size (const M &m, int<N>);
> >>>
> >>>for these operations instead?
> >>>
> >>
> >>I would find it less intuitive.
> >>
> >>Would a free function be possible in MSVC, but a template member
> >>function would not ? (I'm not familiar with MSVC)
> >>
> > 
> > On the long run I see two options: MSVC gets more standard
conforming
> > or we'll have to consider dropping MSVC compatibility to use more
> > language features.
> > 
> > In the meantime free functions could be an easy way to achieve
some
> > compromises.
>
>
> OK.
>
> But what I actually was asking was : are template members in
general not
> possible with MSVC ? (I'm not familiar with MSVC ; I know, there's
a lot
> of bandwidt on MSVC compatibility but I'm lucky to be able to skip
all
> that at the moment)
 
Sorry, I disgressed.
 
Member templates usually are working under MSVC. My problems with
MSVC started, when I tried to define templated nested classes
referencing the outer class, for example:
 
class vector {
    // lots of other stuff
 
    template<class V>
    class iterator_base;
 
    typedef iterator_base<vector> iterator;
    typedef iterator_base<const vector> const_iterator;
};
 
MSVC had the same problems with this code (if I remember correctly)
as we encountered when trying to implement the Barton&Nackman trick
as usual (for the record: we got C2027 compiler errors) .
 
Regards
 
Joerg
 
 
 


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