On Wed, Mar 08, 2023 at 10:13:39AM +, Jonathan Wakely wrote:
> On Wed, 8 Mar 2023 at 07:25, Richard Biener wrote:
> >
> > On Wed, 8 Mar 2023, Alexander Monakov wrote:
> >
> > >
> > > On Tue, 7 Mar 2023, Jonathan Wakely wrote:
> > >
> > > > > Shouldn't this use the idiom suggested in ansidecl.h,
On Wed, 8 Mar 2023 at 07:25, Richard Biener wrote:
>
> On Wed, 8 Mar 2023, Alexander Monakov wrote:
>
> >
> > On Tue, 7 Mar 2023, Jonathan Wakely wrote:
> >
> > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> > > >
> > > > private:
> > > > DISABLE_COPY_AND_ASSIGN (auto_mpfr);
On Wed, 8 Mar 2023, Alexander Monakov wrote:
>
> On Tue, 7 Mar 2023, Jonathan Wakely wrote:
>
> > > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> > >
> > > private:
> > > DISABLE_COPY_AND_ASSIGN (auto_mpfr);
> >
> >
> > Why? A macro like that (or a base class like boost::n
On Tue, Mar 07, 2023 at 09:54:08PM +, Jonathan Wakely via Gcc-patches wrote:
> On Tue, 7 Mar 2023 at 21:52, Alexander Monakov wrote:
> >
> >
> > On Tue, 7 Mar 2023, Jonathan Wakely wrote:
> >
> > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> > > >
> > > > private:
> > > >
On Tue, 7 Mar 2023 at 21:52, Alexander Monakov wrote:
>
>
> On Tue, 7 Mar 2023, Jonathan Wakely wrote:
>
> > > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> > >
> > > private:
> > > DISABLE_COPY_AND_ASSIGN (auto_mpfr);
> >
> >
> > Why? A macro like that (or a base class like bo
On Tue, 7 Mar 2023, Jonathan Wakely wrote:
> > Shouldn't this use the idiom suggested in ansidecl.h, i.e.
> >
> > private:
> > DISABLE_COPY_AND_ASSIGN (auto_mpfr);
>
>
> Why? A macro like that (or a base class like boost::noncopyable) has
> some value in a code base that wants to work fo
On Tue, 7 Mar 2023 at 19:15, Alexander Monakov wrote:
>
> Hi,
>
> On Mon, 6 Mar 2023, Richard Biener via Gcc-patches wrote:
>
> > --- a/gcc/realmpfr.h
> > +++ b/gcc/realmpfr.h
> > @@ -24,6 +24,26 @@
> > #include
> > #include
> >
> > +class auto_mpfr
> > +{
> > +public:
> > + auto_mpfr () { mpf
Hi,
On Mon, 6 Mar 2023, Richard Biener via Gcc-patches wrote:
> --- a/gcc/realmpfr.h
> +++ b/gcc/realmpfr.h
> @@ -24,6 +24,26 @@
> #include
> #include
>
> +class auto_mpfr
> +{
> +public:
> + auto_mpfr () { mpfr_init (m_mpfr); }
> + explicit auto_mpfr (mpfr_prec_t prec) { mpfr_init2 (m_mp
On Tue, Mar 07, 2023 at 07:51:03PM +0100, Bernhard Reutner-Fischer wrote:
> While it's a nice idea, there have been resentments towards (visible)
> C++ in the fortran frontend and especially the library, i think.
I thought libgfortran is written in C and Fortran and doesn't use gmp/mpfr,
so this d
On Mon, 6 Mar 2023 11:29:30 + (UTC)
Richard Biener via Gcc-patches wrote:
> On Mon, 6 Mar 2023, Jakub Jelinek wrote:
>
> > On Mon, Mar 06, 2023 at 11:01:18AM +, Richard Biener wrote:
> > > + auto_mpfr &operator=(const auto_mpfr &) = delete;
> > > + auto_mpz &operator=(const auto_mpz
On Mon, 6 Mar 2023, Jakub Jelinek wrote:
> On Mon, Mar 06, 2023 at 11:01:18AM +, Richard Biener wrote:
> > + auto_mpfr &operator=(const auto_mpfr &) = delete;
> > + auto_mpz &operator=(const auto_mpz &) = delete;
>
> Just formatting nit, space before (.
>
> Looks like nice improvement and
On Mon, Mar 06, 2023 at 11:01:18AM +, Richard Biener wrote:
> + auto_mpfr &operator=(const auto_mpfr &) = delete;
> + auto_mpz &operator=(const auto_mpz &) = delete;
Just formatting nit, space before (.
Looks like nice improvement and thanks Jonathan for the suggestions ;)
Jakub
On Mon, 6 Mar 2023 at 11:01, Richard Biener wrote:
>
> On Mon, 6 Mar 2023, Jonathan Wakely wrote:
>
> > On Mon, 6 Mar 2023 at 10:11, Richard Biener wrote:
> > >
> > > The following adds two RAII classes, one for mpz_t and one for mpfr_t
> > > making object lifetime management easier. Both former
r.
OK, it might be OK to mpfr_clear() twice and/or mpfr_clear/mpfr_init
again. Quite possibly mpfr_init should get the same treatmen, mixing
auto_* with explicit lifetime management is bad.
> > +
> > + auto_mpfr (const auto_mpfr &) = delete;
>
> This class has an implic
On Mon, 6 Mar 2023 at 10:11, Richard Biener wrote:
>
> The following adds two RAII classes, one for mpz_t and one for mpfr_t
> making object lifetime management easier. Both formerly require
> explicit initialization with {mpz,mpfr}_init and release with
> {mpz,mpfr}_clear.
>
> I've converted two
The following adds two RAII classes, one for mpz_t and one for mpfr_t
making object lifetime management easier. Both formerly require
explicit initialization with {mpz,mpfr}_init and release with
{mpz,mpfr}_clear.
I've converted two example places (where lifetime is trivial).
I've sofar only bui
16 matches
Mail list logo