Ignore:
Timestamp:
Apr 23, 2021, 8:51:43 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
c18a79
Parents:
2b88eb
git-author:
Frederik Heber <frederik.heber@…> (11/25/20 00:09:13)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 20:51:43)
Message:

Observable_protector requires noexcept(false).

  • otherwise we cannot use the CircleDetection unit test anymore as C++11 default behavior is to terminate if an exception is thrown during a destructor (here, Observable_protector, i.e. OBSERVE; going out of scope). The unit test expects an AssertionFailure which we then no longer obtain but the whole test terminates. Therefore we set to noexcept(false) and allow exceptions to escape.
Location:
ThirdParty/CodePatterns/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ThirdParty/CodePatterns/src/CodePatterns/Observer/Observable.hpp

    r2b88eb r77c4a0  
    186186    _Observable_protector(Observable *);
    187187    _Observable_protector(const _Observable_protector&);
    188     ~_Observable_protector();
     188    /*
     189     * Since C++11 exceptions thrown during a destructor will always result
     190     * in terminate. Here, however, we throw an AssertionFailure in case
     191     * we detec a circle in the observation DAG. For the unit test to be
     192     * useful, we need the exception to be handled normally (and not
     193     * terminate). Hence, we set the behavior to allowing exceptions here.
     194     */
     195    ~_Observable_protector() noexcept(false);
    189196  private:
    190197    Observable *protege;
  • ThirdParty/CodePatterns/src/Observer/Observable.cpp

    r2b88eb r77c4a0  
    127127 * \param *protege Observable to be protected.
    128128 */
    129 Observable::_Observable_protector::~_Observable_protector()
     129Observable::_Observable_protector::~_Observable_protector() noexcept(false)
    130130{
    131131  finish_observer_internal(protege);
Note: See TracChangeset for help on using the changeset viewer.