Boost logo

Boost Users :

Subject: Re: [Boost-users] conflicting intmax_t definitions - Boost 1.53 and gcc 4.8 incompatibility?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2014-01-21 19:45:57


On 22/01/2014 12:44, Quoth Leon Mlakar:
> On 21/01/14 23:31, Gavin Lambert wrote:
>> I've been wondering if a better strategy might be to explicitly
>> typedef or "using" the versions I want into the global namespace (or
>> an "app" namespace) in a common header and then use those everywhere
>> instead. Though this is fragile against a misplaced "using namespace".
[...]
> But your suggestion it the last paragraph is intriguing if combined with
> using type aliases and explicit namespace for symbols used in
> applications - something like mytypes::shared_ptr or appdef::string ...
> it is just a soft of half-baked idea at the moment, For now I'm still
> scratching at the surface of C++11, but we did use type aliases in past
> C# projects, and the C++ seem to have the advantage of allowing aliases
> for template classes. I'll give this some thought in the future. I
> really wonder what sorts of patterns will emerge from this.

Yes, one of the reasons why I haven't been using that strategy thus far
is that most of the code I work with is still C++03, and lacks the
ability to define a "simple" alias for a templated type(*) -- and most
of the types I'd want to do this with are templates (containers and
smart pointers).

(*) I don't consider having to use "select_my_vector<T>::type"
sufficiently simple, vs. "my::vector<T>" -- especially when I don't want
client code to have to care/change whether this is a typedef or a
reimplementation.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net