Release candidate files for 1.53.0 are available at
http://boost.cowic.de/rc/
As always, the release managers would appreciate it if you download
the candidate of your choice and give building it a try. Please report
both success and failure, and anything else that is noteworthy.
This helps ensure the candidates build OK before we push them out to
SourceForge.
The files (and associated md5s) are:
57a9e2047c0f511c4dfcf00eb5eb2fbb *boost_1_53_0_rc1.tar.gz
a00d22605d5dbcfb4c9936a9b35bc4c2 *…
[View More]boost_1_53_0_rc1.tar.bz2
c618e030fd4882e4dbacf54baf824544 *boost_1_53_0_rc1.zip
cc680cab53a5405ca102a10d43b92b88 *boost_1_53_0_rc1.7z
Thanks!
-- The release managers
[View Less]
Hello Mathias,
I'm afraid you didn't get the point. Let me explain.
>> The object will only be constructed when instance() is called
Technically, yes, the instance will be create once singleton::instance is
called for the first time, but in order to make it constructed BEFORE main,
singleton::instance has to be called during static data initialization, and
static_init GUARANTIES that this static initialization will be performed
before main WITH NO additional calls.
>> If the …
[View More]constructor of the object depends on
>> other singletons, then instance() of those other singletons
>> will naturally be called before, and therefore they
>> will end up being constructed before.
You're right, if you refer to singleton A's before creating singleton B's
instance, to order of initialization would be correct. But let's no limit
this case to singletons only, where initialization is achieved in just one
call. There can many many different situation when you have to perform some
additional data initialization and manipulation before creating singleton
instance. Where would you put this code? Would you make singleton
constructor or instance access method dependent on all this data when it
naturally should not be?
Anyway it doesn't solve the problem for the first call to a singleton if it
has to be initialized before main. Unless you create a global static
variable and make the first call to singleton during this variable
initialization, but then you still need to refer to this variable from the
code somewhere in order to make sure your compiler does not eliminate it
due to optimization reasons, and this way you will introduce unnecessary
dependency.
3. There is no construction recursion. If you did notice it somewhere,
please point to exact place.
4. Static data construction order is undefined by C++ standard fixing it
requires either changing the standard or getting rid of class and global
static data.
So, again, to make the idea crystal clear, the initial goal was:
1. Guarantee that static constructor method is called before main is
executed
2. No additional calls in either global or any local scope
should precede static constructor invocation in order not to introduce
extra dependencies and eliminating a situation when
initialization invocation code does not get called for any reason.
3. Provide a way to control the order of static constructors calls. No
recursions are allowed.
The described approach fully satisfies the three simple requirements. If
anybody sees possible errors or ways to improve it, feedbacks are very
appreciated.
Thank you.
______________________________
With best regards,
Alexander Stoyan
[View Less]
I am having trouble building Boost 1.52.0 libraries with g++ 4.7.2 on Linux Fedora 14. I was able to build it with 4.7.1, and I think our Systems guys configured 4.7.2 the same as 4.7.1, so I need help.
This is in my user-config:
using gcc : 4.7.2 : /opt/gcc-4.7.2/bin/g++ :<compileflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp"<linkflags>"-fPIC -fno-strict-aliasing -fno-tree-ccp" ;
This is my command line:
bin/bjam --user-config=user-config.LINUX_INTF14X threading=multi …
[View More]instruction-set=core2 address-model=64 variant=release link=static,shared --stagedir=stageF14X
And this is the result (snipped out redundant info):
Building the Boost C++ Libraries.
Performing configuration checks
- x86 : no
- power : no
- arm : no
- mips1 : no
error: No best alternative for libs/context/build/asm_context_sources
next alternative: required properties:<abi>aapcs<architecture>arm<binary-format>elf<toolset>gcc
not matched
next alternative: required properties:<abi>aapcs<architecture>arm<binary-format>elf<toolset>qcc
not matched
[snip]
next alternative: required properties:<abi>ms<address-model>64<architecture>x86<binary-format>pe<target-os>windows
not matched
- has_icu builds : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
- iconv (libc) : no
- iconv (separate) : no
- icu : no
- icu (lib64) : no
- Boost.Locale needs either iconv or ICU library to be built.
[snip]
- Boost.Locale needs either iconv or ICU library to be built.
- gcc visibility : no
- long double support : no
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
error: No best alternative for libs/context/build/asm_context_sources
next alternative: required properties:<abi>aapcs<architecture>arm<binary-format>elf<toolset>gcc
not matched
[snip]
--
Dick Hadsell 203-992-6320 Fax: 203-992-6001
Reply-to: hadsell(a)blueskystudios.com
Blue Sky Studios http://www.blueskystudios.com
1 American Lane, Greenwich, CT 06831-2560
[View Less]
*static_vector is a hybrid of boost::container::vector and boost::array
with fixed capacity.
Adam Wulkiewicz and I have updated static_vector with improvements from the
list discussion and reorganized it for possible inclusion into
boost.container.
Overview:
static_vector is a sequence container with contiguous storage that can
change in size like boost::container::vector. It also includes static
allocation, low overhead, and fixed capacity similar to boost::array.
Synopsis:
template*
*<*
…
[View More]* typename Value, *
* std::size_t Capacity, *
* typename Strategy =
strategy::def<https://svn.boost.org/svn/boost/sandbox/static_vector/doc/html/static_vecto…>
<Value> *
*>*
*class static_vector;
Example:
// static_vector of ints, fixed capacity: 3
boost::container::static_vector<int,3> three; // size: 0
three.push_back(1); // size: 1
three.push_back(2); // size: 2
three.push_back(3); // size: 3
//three.reserve(4); // no effect, fixed capacity: 3
//three.push_back(3); // size: 4, undefined behavior
three.pop_back(); // size: 2
three.shrink_to_fit(); // no effect, fixed capacity: 3
Documentation:
https://svn.boost.org/svn/boost/sandbox/static_vector/doc/html/index.html
Source:
https://svn.boost.org/svn/boost/sandbox/static_vector/
Discussions from boost.devel archive:
http://goo.gl/PKEpB [google groups]
Changes:
- C++11 support
- moved to boost::container namespace
- strategy based error handling (“strategy” is aka “policy”)
- bounds checks are asserts by default but can be switched to exceptions
- memory is uninitialized until objects are inserted
- internal size is currently the same as Strategy::size_type
- expanded documentation and unit tests
- optimizations based on type traits
- boost::interprocess support
------------------------------------------------
------------------------------------------------
Major questions from prior list discussions and the related design
decisions:
------------------------
Q1:
static_vector design
*a) combination of fixed capacity vector and adjustable size array
b) vector with small size optimization, possibly with configuration of what
“small size” means.
A1:
(a) is implemented by static_vector, leaving the (b) as future work for a
separate class.
------------------------
Q2:
Is it best to implement push_back() and similar functions with or without
bounds check?
Main use cases:
*a) no bounds check on each insertion because it is an undesirable use of
resources
b) vector emulation where static_vector is a drop in replacement and
optimization so bounds checking is essential to minimize the amount of code
that must be changed.
A2:
(a) no bounds check is the default for static_vector. A vector emulation
strategy can be implemented for (b).
------------------------
Q3:
Should a failed bounds check trigger an assertion or an exception?
Main use cases:
a) bounds check is too much overhead, but assert() allows for testing in
debug mode
b) vector emulation, so bad_alloc should be thrown when the capacity is
exceeded
c) exceptions are desired when bounds checking, but bad_alloc would cause
the wrong behavior because freeing up memory will not allow the possibility
of a larger capacity as it would in a vector.
A3:
(a) failed bounds checks trigger an assertion, and the user can implement
the necessary strategy and traits to achieve (b) or (c).
------------------------------------------------
------------------------------------------------
New/Unanswered Questions:
------------------------
Q4:
Should the current static_vector actually be in the detail namespace, with
policy specializations providing the actual interface to several classes
with different desired functionality?
This could be similar to what was suggested by Nate Ridge:
On Sat, Oct 15, 2011 at 5:16 PM, Nathan Ridge <zeratul976(a)hotmail.com>
wrote:
> Now the implementor of these classes can implement them like this:
>
> typedef boost::detail::static_vector<T, AssertPolicy> capacity_array;
> typedef boost::detail::static_vector<T, ThrowPolicy> stack_vector;
It also seems to be backed by the fundamental interface differences between
the various classes (static_vector, std::vector, AutoBuffer/hybrid_vector)
as outlined by Dave Abrahams:
On Wed, Oct 19, 2011 at 1:26 PM, Dave Abrahams <dave(a)boostpro.com> wrote:
> I see a container that can never store more than N items, for some
> reasonably small N, as fundamentally, semantically different from one
> that is highly likely to be able to store any M items you have to deal
> with, and for which you can't determine a hard limit N ahead of time
> (no, max_size() doesn't count—that's typically just
> numeric_limits<size_t>::max()). I grant you that we don't have a very
> strict way of expressing this difference in a specification, but I think
> that's just missing. I wouldn't, except in very special circumstances,
> consider one of those containers to be a suitable replacement for the
> other, despite the similarity of the specification text. Would you?
This would mean that the official interfaces can be specific to various
common use cases and a bit simpler. An additional benefit here is that
simpler interfaces are more welcoming to a wider range of developers.
On the other hand, the current design makes the official interface
configurable so they could customize it without being as concerned about
changes in the detail implementation. If everyone will want something
different for their specific use case, leaving the design as is may make
the most sense. Furthermore, a reasonable default provides a simpler
interface while permitting advanced configuration for those who need it.
------------------------
Q5:
Should the static_vector Strategy concept
(a) remain as is
(b) add the Capacity as an additional template parameter
(c) permit Standard Library Allocators as a strategy
Currently, the default traits assume that the Strategy defines types
normally defined by Allocator and provides a capacity check failure
callback. Also, a different strategy and traits specialization can be used
to configure the class as desired, such as modifying the size_type based on
the Capacity. Consequently, leaving the Strategy as is (a) remains fairly
reasonable.
Adding an additional Capacity template parameter (b) to the Strategy
concept would take the Strategy further from the Allocator concept, but
ensure configuration of size_type based on the capacity is easy and
consistent.
We believe (c) does not make sense despite allowing static_vector to be
more compatible with vector due to the fundamental interface differences
discussed in Q4. Option (c) makes more sense for a class like
AutoBuffer/hybrid_vector than it does for static_vector.
Thus, the question ultimately becomes one concerning the tradeoff between
options (a) and (b).
------------------------
Q6:
Should static_vector_traits be part of the public interface or remain in
the detail namespace?
This would make some of the functionality in Q5a part of the official
interface, but restrict future changes. In Boost.Container traits are
defined in the detail namespace so we were hoping to find out the reasoning
for this choice.
The direction of the design discussion for Q4 could also make this a moot
point.
------------------------
Q7:
Does static_vector provide significant benefits over
boost::container::vector with a stack Allocator template parameter?
This has been discussed previously and we believe the answer is yes for the
reasons outlined in Q4 and the documentation, but we wanted to bring it up
again in case someone wanted to play devil’s advocate.
------------------------
That covers all the basics of the updated static_vector implementation and
some of the biggest outstanding design questions. We appreciate any and all
questions, design ideas, or issues you can come up with, so fire away. :-)
Regards,
Andrew Hundt*
Adam Wulkiewicz
[View Less]
I'm trying to bring varray over to github with modular boost, but since we
just moved it from static_vector to varray the history is split between two
directories. I have been able to run git svn on each directory
independently and then pull the static_vector one into the varray one on a
separate branch. I then want to stack all the versions so that they are
continuous, but I am not sure how to do this.
my steps so far:
git svn clone http://svn.boost.org/svn/boost/sandbox/varray varray
git svn …
[View More]clone http://svn.boost.org/svn/boost/sandbox/static_vector varray2
cp -a varray varray3 # backup
# git pull command here that brings it into another branch
Also, I'd be happy to take suggestions of better ways to accomplish this.
I've noticed that all the dates on github.com/boostorgrepository
changes are getting old and are up to nearly a month now, have
the updates stopped working?
Cheers!
Andrew Hundt
[View Less]
Hi all!
I was wondering why the dereference operator of counting_iterator<T> returns a constant reference to
T instead of a reference to T.
Naively I would expect counting_iterator<T>::reference to be T& and counting_iterator<const
T>::reference to be const T&.
I suppose however that there was good reason to implement counting_iterator the way it is
implemented. Could anyone kindly point this reason out to me?
Regards
Claas
On Fri, Jan 25, 2013 at 10:21 AM, Dave Abrahams <dave(a)boostpro.com> wrote:
> Yes. IIUC the question here is whether the invariant of variant [;-)]
> shall be weakened to accommodate efficient move semantics, thereby
> breaking some code, or not, at some cost (the specific costs to be
> incurred by various strategies presently under discussion).
I'm new to this list, so I won't be offended if you correct me on any rookie
mistakes.
Concerning the invariant of variant:
…
[View More]Why not provide a specialization of boost::optional for variant, which
supports move
Semantics? Users who don't want their invariant harmed, can use
boost::variant as is.
Users who need to squeeze out performance could use an optional<variant> and
would
be explicitly aware of the new null state they introduced for this.
Markus
www.clean-cpp.org
[View Less]
Hi guys,
If ssl client cannot read data from server
(SSL_connect: error in SSLv2/v3 read server hello A),
handshake handler is not called.
Is this by design? Or, probably, it should be called with error anyway.
Thanks in advance.
Alex
Hello community,
I have implemented static constructors for my personal needs. They
guarantee construction of static data prior main execution, and allow
control the order of static initialization. The code now implemented and
tested for VS2012 and GCC.
I couldn't find anything like this in the boost library but consider it to
be useful for C++ developers.
More detailed approach on my blog page:
http://alexander-stoyan.blogspot.com/2013/01/static-constructors-in-c.html
Feedbacks are very …
[View More]appreciated.
Thank you.
______________________________
With best regards,
Alexander Stoyan
[View Less]
> Message: 9
> Date: Mon, 28 Jan 2013 11:05:07 -0500
> From: Beman Dawes <bdawes(a)acm.org>
> To: boost(a)lists.boost.org
> Subject: Re: [boost] [filesystem] thread safety on msvc 2010
> Message-ID:
> <
> CAAygHNO8u+gvpGABgJR-KxSP-EqvhyRWRCSKKwx_7chH2hesSg(a)mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Some critical points to getting a patch accepted are that it applies
> only to the affected platform (i.e. Windows) …
[View More]and that it includes test
> cases that fail with the current code but pass with the patch applied.
> If it works for you with msvc 2010, I can test with other versions and
> compilers.
>
> Thanks,
>
> --Beman
>
>
Ok, I have some test code I could submit. Is it all right to use
boost::threads in the test so it is cross platform?
It might be a while (have trip for work soon) until I have time to pull svn
(or git, looks like that move is happening soon) and make the patch, but I
will try to follow up on this when I get back.
Thanks,
Jacob
PS: Sorry if this broke threading. I just switched off of the digest
[View Less]