![]() |
Boost : |
From: Jean-Louis Leroy (jl_at_[hidden])
Date: 2025-05-02 18:23:37
> I am working through the documents and found myself a little troubled that
> there is a need to initialise the subsystem in main():
I know...I don't like it either...the Dlang version auto-initializes.
> It occurs to me that this can be solved using the Schwartz Counter (or Nifty
> Counter) method, which because of inline variables, works fully using only
> header files as of C++17.
I don't think so. The problem is that initialize() must be called after all the
static registrar objects have executed, and before the first method call.
With msvc, I could use init_seg. But I see no general solution. But I would be
delighted to be proven wrong.
> Thanks for your time.
Thank you for your feedback!
J-L
On Fri, May 2, 2025 at 7:24â¯AM Richard Hodges via Boost
<boost_at_[hidden]> wrote:
>
> On Sun, 27 Apr 2025 at 15:15, ÐмиÑÑий ÐÑÑ
ипов via Boost <
> boost_at_[hidden]> wrote:
>
> > Dear Boost community. The peer review of the proposed Boost.OpenMethod will
> > start on 28th of April and continue until May 7th. OpenMethods implements
> > open
> > methods in C++. Those are "virtual functions" defined outside of classes.
>
>
> Thank you, this is a welcome development.
>
> I am working through the documents and found myself a little troubled that
> there is a need to initialise the subsystem in main():
>
> #include <boost/openmethod/compiler.hpp> // only needed in the file that
> calls boost::openmethod::initialize() auto main() -> int { boost::openmethod
> ::initialize(); // ... }
>
> This prevents this library being used as a dependent subsystem within other
> libraries, as the publisher of the library would need to communicate the
> need for this manual initialisation down the chain of dependent projects.
> This is brittle.
>
> It occurs to me that this can be solved using the Schwartz Counter (or
> Nifty Counter) method, which because of inline variables, works fully using
> only header files as of C++17.
>
> In case this is new information, the Schwartz Counter is the mechanism by
> which std::cout and std::cin are made available by the standard library.
>
> Thanks for your time.
>
>
> >
> >
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk