[Dune] [Dune-Commit] dune-common r7040 - in trunk/dune/common: . test
Christian Engwer
christian.engwer at uni-muenster.de
Thu Oct 18 00:21:43 CEST 2012
On Thu, Oct 18, 2012 at 12:16:19AM +0200, Martin Nolte wrote:
> Can't blame you. We try to support a large variety of compilers by now.
>
> Should we add a configure test for explicit cast operators? They are
> definitely very useful.
for the time beeing I removed the explicit keyword... this code is
only fallback and actually I would like to get rid of it asap.
Christian
> Martin
>
> On 10/18/2012 12:14 AM, Christian Engwer wrote:
> >On Thu, Oct 18, 2012 at 12:05:22AM +0200, Martin Nolte wrote:
> >>Hi Christian,
> >>
> >>as far as I know, explicit cast operators do not conform to C++03.
> >>Have you tried an older gcc version (e.g. 4.1)?
> >
> >grmpf... you might be right... I only tested with the problematic
> >4.5...
> >
> >Christian
> >
> >>Best,
> >>
> >>Martin
> >>
> >>On 10/17/2012 11:08 PM, christi at dune-project.org wrote:
> >>>Author: christi
> >>>Date: 2012-10-17 23:08:39 +0200 (Wed, 17 Oct 2012)
> >>>New Revision: 7040
> >>>
> >>>Modified:
> >>> trunk/dune/common/shared_ptr.hh
> >>> trunk/dune/common/test/shared_ptrtest.cc
> >>>Log:
> >>>[shared_ptr]
> >>>test initialization from nullptr
> >>>fix bool cast of Dune implementation
> >>>
> >>>Modified: trunk/dune/common/shared_ptr.hh
> >>>===================================================================
> >>>--- trunk/dune/common/shared_ptr.hh 2012-10-17 17:06:23 UTC (rev 7039)
> >>>+++ trunk/dune/common/shared_ptr.hh 2012-10-17 21:08:39 UTC (rev 7040)
> >>>@@ -110,6 +110,11 @@
> >>> return rep_==0 ? 0 : rep_->rep_;
> >>> }
> >>>
> >>>+ /** \brief Checks if shared_ptr manages an object, i.e. whether get() != 0. */
> >>>+ explicit operator bool() const {
> >>>+ return rep_ != 0&& rep_->rep_ != 0;
> >>>+ }
> >>>+
> >>> /** \brief Swap content of this shared_ptr and another */
> >>> inline void swap(shared_ptr& other);
> >>>
> >>>
> >>>Modified: trunk/dune/common/test/shared_ptrtest.cc
> >>>===================================================================
> >>>--- trunk/dune/common/test/shared_ptrtest.cc 2012-10-17 17:06:23 UTC (rev 7039)
> >>>+++ trunk/dune/common/test/shared_ptrtest.cc 2012-10-17 21:08:39 UTC (rev 7040)
> >>>@@ -128,6 +128,11 @@
> >>> shared_ptr<double> bar(new double(43.0));
> >>> assert(bar);
> >>>
> >>>+ // test constructor from nullptr
> >>>+ shared_ptr<double> bar_null(nullptr);
> >>>+ assert(!bar_null);
> >>>+ assert(!bar_null.get());
> >>>+
> >>> // test reset()
> >>> bar.reset();
> >>> assert(!bar);
> >>>
> >>>
> >>>_______________________________________________
> >>>Dune-Commit mailing list
> >>>Dune-Commit at dune-project.org
> >>>http://lists.dune-project.org/mailman/listinfo/dune-commit
> >>
> >>--
> >>Dr. Martin Nolte<nolte at mathematik.uni-freiburg.de>
> >>
> >>Universität Freiburg phone: +49-761-203-5630
> >>Abteilung für angewandte Mathematik fax: +49-761-203-5632
> >>Hermann-Herder-Straße 10
> >>79104 Freiburg, Germany
> >>
> >>_______________________________________________
> >>Dune mailing list
> >>Dune at dune-project.org
> >>http://lists.dune-project.org/mailman/listinfo/dune
> >>
> >
>
> --
> Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>
>
> Universität Freiburg phone: +49-761-203-5630
> Abteilung für angewandte Mathematik fax: +49-761-203-5632
> Hermann-Herder-Straße 10
> 79104 Freiburg, Germany
>
--
Prof. Dr. Christian Engwer
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster
E-Mail christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX +49 251 83-32729
More information about the Dune
mailing list