|
Boost : |
Subject: Re: [boost] Fw: Interlibrary version cchecking
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-10-19 06:49:27
David Abrahams wrote:
> Robert Ramey wrote:
> > David Abrahams wrote:
> > > Robert Ramey wrote:
> > >>
> > >>> Your scheme seems a lot more complicated than industry standard
> > >>> practice, which is to use one or two long integer constants as
> > >>> macros (c.f. __GCC_VERSION__ and friends).
[snip]
> > I was referring to the scheme itself - I don't remember where
> > I saw it but maybe I cited the wrong page. ....so files have
> > major and minor release. I think that the major one refers to
> > an api change while the minor refers to an implemenation
> > change and/or enhancement.
>
> Yes, that's "industry standard" practice.
Exactly
> > >>> That's also useful for > #ifdefing, whereas
> > >>> mpl::int_<>s are not.
> > >>
> > >> Well, if you want to enhance my proposal to add constants and
> > >> have the mpl_<... or static assert use those constants, that
> > >> would be fine with me.
> >
> > > Why do you want the mpl_<...> thing in the first place?
That was my question, too. It would even mean that MPL couldn't be versioned like everything else because it would be foundational to all other versioned libraries.
> > So that immediately when attampting to compile things would crap out
> > and not depend on this or that instantiation.
>
> #defines do that nicely too.
+1
> > I wouldn't have to scatther #ifdef/... all over the place.
>
> I don't know what you're talking about. Wouldn't you just do
> something like
>
> STATIC_ASSERT(LIBFOO_VERSION >= 4001003);
>
> ? I don't see any #ifdefs here.
+1
It can be useful to define not only a standardized way of encoding the values but to provide macros to extract the components:
STATIC_ASSERT(BOOST_MAJOR_VERSION(LIBFOO_VERSION) == 4);
STATIC_ASSERT(BOOST_MINOR_VERSION(LIBFOO_VERSION) >= 1);
versus:
STATIC_ASSERT(LIBFOO_VERSION >= 4001000 && LIBFOO_VERSION < 5000000);
> The advantage I was citing for a preprocessor #define is that you
> *can* use #ifdefs, if and where you need them. It doesn't mean you
> have to. They do everything your mpl typedefs do, and more.
+1
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk