Skip to content
Snippets Groups Projects
  1. Sep 16, 2016
  2. Sep 13, 2016
  3. Sep 05, 2016
  4. Sep 02, 2016
  5. Aug 29, 2016
    • Carsten Gräser's avatar
      [hybrid] Add a switch statement · a6d255fd
      Carsten Gräser authored
      This can be used with an std::integer_sequence. If a
      matching entry is found the given function is executed
      with _statically_ encoded matching value.
      This does, e.g., allow to make a dynamic value static
      if it's in a known range.
      a6d255fd
    • Carsten Gräser's avatar
      Properly determine return values · d13f8ea7
      Carsten Gräser authored
      By using decltype(auto) we can also handle returned references.
      Unfortunately some constexpr qualifiers have to be dropped because
      they are not supproted with gcc-4.9
      d13f8ea7
  6. Aug 26, 2016
  7. Aug 25, 2016
  8. Aug 24, 2016
    • Carsten Gräser's avatar
      [hybrid] Change return type of Hybrid::ifElse from void to auto · e7c58c90
      Carsten Gräser authored
      Since Hybrid::ifElse() is essentially an if statement, having
      support for return values looks strange. However, this is not
      visible if you don't use it and allows to at least partially
      emulate returning from functions inside of ifElse()-branches.
      
      Before you could not return from those branches, because they
      are functions themselves that 'eat up' the return statement.
      Now you can at least return values for cases where both
      branches would return.
      
        template<class T
        auto fooOrBar(T t) {
          return ifElse(models<HasFoo, T>(), [&](auto id) {
            return id(t).foo();
          }, [&](auto id) {
            return id(t).bar();
          });
        }
      
      Mind the additional "return" in front of ifElse() that
      which is needed to forward the returned value
      Notice that it's not required that both branches have the same
      return type if isElse() is in static mode.
      e7c58c90
    • Carsten Gräser's avatar
      [concept] Return check result as std::integral_constant<bool, *> · b4f37070
      Carsten Gräser authored
      By using "std::integral_constant<bool, *>" instead of "constexpr bool"
      as return type for Dune::models(), the result can directly be used
      in Dune::Hybrid::ifElse():
      
        T t;
        ifElse(models<HasFoo, T>(), [&](auto id) {
          id(t).foo();
        }, [&](auto id) {
          id(t).bar();
        });
      
      Before one would have to create the integral constant manually
      to turn ifElse() into static mode. The change is backward compatible
      because integral_constant<bool, *> casts to bool.
      
      Notice that this change requires a small reorganization of code.
      To use models() internally we need a forward declaration which
      is not possible if the type is deduced (as it is now). Hence
      a new function Imp:models() with "constexpr bool" return type
      is added for internal use. Its result is encoded as integral_constant
      by the actual interface method.
      b4f37070
    • Carsten Gräser's avatar
      [std] Implement Std::bool_constant · 777f016c
      Carsten Gräser authored
      This implements the helper template bool_constant from
      C++17 in namespace Dune::Std. This is just an alias for
      std::integral_constant<bool, *> that makes code more readable.
      
      If the standard feature checks indicate its existence in
      std:: or std::experimental:: it's pulled from there.
      777f016c
  9. Aug 22, 2016
    • Carsten Gräser's avatar
      Merge branch 'feature/isnumber-trait' into 'master' · 9bf86305
      Carsten Gräser authored
      Add IsNumber trait, extending std::is_arithmetic
      
      Since it's very difficult to make progress on !52, I'll start to break it up into smaller, less controversial changes. This is the first piece that I'd also like to use in other places. An `IsNumber` trait allows us to determine when we've hit the bottom in a recursion without a `blocklevel` and things like `FieldVector<ctype, 1>`.
      
      `IsNumber` is currently true for: floating point types, gmp fields, and such types wrapped in `std::complex`.
      
      See merge request !105
      9bf86305
  10. Aug 12, 2016
  11. Aug 06, 2016
  12. Aug 05, 2016
    • Dominic Kempf's avatar
      Merge branch 'feature/remove-autotools' into 'master' · bbbdd62a
      Dominic Kempf authored
      Feature/remove autotools
      
      Finally, after 4.5 years of discussion, development and testing, we get rid of Autotools! 🍾 Thanks to Markus, Dominic and everybody who joined this journey.
      
      The Dune website no longer uses WML, so can get rid of the Autotools. I propose to merge this branch and see what happens. There are more Autotools left-overs, we have to find and remove them. If everything goes well, we can remove Autotools from the other core modules as well.
      
      See merge request !118
      bbbdd62a
  13. Aug 03, 2016
  14. Aug 02, 2016
Loading