Skip to content
Snippets Groups Projects
  1. Nov 28, 2016
  2. Nov 26, 2016
  3. Nov 25, 2016
  4. Nov 24, 2016
    • Christian Engwer's avatar
      Merge branch 'feature/assert-and-return' into 'master' · 1410d4a9
      Christian Engwer authored
      Add macro DUNE_ASSERT_AND_RETURN
      
      This is an alternative to !128.
      
      In C++11 and with not fully C++14 compliant compilers `constexpr` functions
      can only have a return statement. This prevents the use of `assert()` inside
      of `constexpr` functions. This macro can be used as a workaround like this:
      
      ```c++
        constexpr auto foo(int a, int b, x)
        {
          return DUNE_ASSERT_AND_RETURN(a<b, x);
        }
      ```
      
      For `NDEBUG` there is no penalty. Otherwise there are two options:
      * In a non-`constexpr` context an `assert()` will fail if the condition
        is not matched. The error message will be slightly different from a
        classic assertion.
      * In a `constexpr` context the `assert()` branch will be ignored if the
        is condition is matched. Otherwise this will lead to a compile error
        (like `static_assert`) because the branch using `assert()` is not `constexpr`.
      
      See merge request !142
      1410d4a9
    • Christian Engwer's avatar
      Merge branch 'feature/prevent-empty-cmake-module-path' into 'master' · 68f429a9
      Christian Engwer authored
      Do not set and empty CMAKE_MODULE_PATH when calling cmake.
      
      It seems like this causes problems on some platforms. If the path is empty
      we can leave it unset anyway.
      
      See merge request !175
      68f429a9
    • Christoph Grüninger's avatar
      Merge branch 'feature/cmake-guard-for-mpi-tests' into 'master' · 6aa023e6
      Christoph Grüninger authored
      Use CMAKE_GUARD for tests that require MPI
      
      This results in a consistent message explaining why the test was
      skipped.
      
      See merge request !185
      6aa023e6
  5. Nov 23, 2016
  6. Nov 22, 2016
    • Ansgar Burchardt's avatar
      Correct spelling errors [ci skip] · 005780c9
      Ansgar Burchardt authored
      005780c9
    • Ansgar Burchardt's avatar
      Add correct offset for end of chunk · 040d2a87
      Ansgar Burchardt authored
      Using `&current->chunk_ + x` will add `x * sizeof(current->chunk_)` to
      the pointer, but we only want to add `x`.
      
      Adding a much larger number still "works" on 64bit systems (although it
      does not perform the intended check). However on 32bit platforms this
      wraps (at least in the way used by sllisttest.cc) and the "end" of the
      chunk is suddenly before the beginning.
      
      Closes #57
      040d2a87
  7. Nov 20, 2016
    • Carsten Gräser's avatar
      Merge branch 'feature/fix-forloop' into 'master' · b8d06d5c
      Carsten Gräser authored
      [bugfix] Fix possible memory corruption in ForLoop
      
      The reason for perfect forwarding is to also forward r-values as
      r-value references such that the called function can do a move
      on such values.
      As a consequence you should never call `std::forward` on the same
      object twice because the second function may get a moved from
      object since the first one has already stolen the data. E.g.
      for the following operation
      ```cpp
        template<int i>
        struct Operation
        {
          static void apply(std::vector<int> v)
          {}
        };
      ```
      a call to
      ```cpp
        Dune::ForLoop<Operation, 0, 1>::apply(std::vector<int>{1,2,3});
      ```
      will pass a moved from vector in an undefined state on the second call.
      
      BTW: The same error existed in the old implementation of `ForLoop`
      
      See merge request !177
      b8d06d5c
  8. Nov 19, 2016
  9. Nov 18, 2016
    • Carsten Gräser's avatar
      [bugfix] Fix possible memory corruption in ForLoop · 2277612d
      Carsten Gräser authored
      The reason for perfect forwarding is to also forward r-values as
      r-value references such that the called function can do a move
      on such values.
      
      As a consequence you should never call std::forward on the same
      object twice because the second function may get a moved from
      object since the first one has already stolen the data. E.g.
      for the following operation
      
        template<int i>
        struct Operation
        {
          static void apply(std::vector<int> v)
          {}
        };
      
      a call to
      
        Dune::ForLoop<Operation, 0, 1>::apply(std::vector<int>{1,2,3});
      
      will pass a moved from vector in an undefined state on the second call.
      
      BTW: The same error existed in the old implementation of ForLoop
      2277612d
    • Ansgar Burchardt's avatar
      Merge branch 'cleanup/extra-semicolon' into 'master' · e683e1df
      Ansgar Burchardt authored
      [cleanup] fix warning: extra ‘;’ [-Wpedantic]
      
      This removes the extra ‘;’ warnings when compiling with -Wpedantic.
      
      See merge request !176
      e683e1df
    • Felix Gruber's avatar
      f9d1bf56
  10. Nov 17, 2016
  11. Nov 14, 2016
Loading