global.hh 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // -*- mode: c++; coding: utf-8 -*-
  2. /// @file global.hh
  3. /// @brief Had to break namespace hygiene.
  4. // (c) Daniel Llorens - 2016
  5. // This library is free software; you can redistribute it and/or modify it under
  6. // the terms of the GNU Lesser General Public License as published by the Free
  7. // Software Foundation; either version 3 of the License, or (at your option) any
  8. // later version.
  9. #pragma once
  10. #include "ra/wedge.hh"
  11. #include "ra/atom.hh"
  12. // Cf using std::abs, etc. in real.hh.
  13. using ra::odd, ra::every, ra::any;
  14. // These global versions must be available so that e.g. ra::transpose<> may be searched by ADL even when giving explicit template args. See http://stackoverflow.com/questions/9838862 .
  15. template <class A>
  16. requires (ra::is_scalar<A>)
  17. inline constexpr decltype(auto) transpose(A && a) { return std::forward<A>(a); }
  18. // We also define the scalar specializations that couldn't be found through ADL in any case. See complex.hh, real.hh.
  19. // These seem unnecessary, just as I do ra::concrete() I could do ra::where(). FIXME
  20. template <int cell_rank>
  21. inline constexpr void iter() { abort(); }