Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2002-01-21 13:47:48


On Mon, 2002-01-21 at 19:30, Darin Adler wrote:
> On 1/21/02 3:18 AM, "Samuel Krempp" <krempp_at_[hidden]> wrote:
>
> > Apparently, MSVC compatibilty requires, among other things, that I
> > define template members inside the class definition,
> > thus I'll need to redesign the whole structure.
>
> Oh no! On other platforms that's going to result in them all being treated
> as if they were declared with "inline". Sounds bad to me.

I plan to use a small inline member functions, calling out-of class
'method-like' functions :

namespace exiled_methods {

template<class T>
int do_that(format& self, const T& x);

}

class format {
[..]
template<class T>
int do_that(const T& x) { do_that(*this, x); }

template<class T>
friend int exiled_methods::do_that(format&, const T&);
};

this work-around is quite a code bloat, but it should not have any
impact on performance.

Errr, then again, maybe MSVC refuses friend template declarations..

then I'll hesitate between making everything public,
or making all template methods inline..

Does MSVC accept friend template declarations ?

-- 
Samuel

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