QUGaR 0.0.4
Loading...
Searching...
No Matches
utils.hpp File Reference

Utility functions. More...

#include <qugar/types.hpp>
#include <cassert>
#include <cstddef>
#include <initializer_list>
#include <span>
Include dependency graph for utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  qugar
 QUGaR's main namespace.
 

Functions

template<class T , class V >
constexpr T qugar::narrow_cast (V &&val) noexcept
 
template<class T , std::size_t N>
constexpr T & qugar::at (T(&arr)[N], const index ind)
 
template<class Cont >
constexpr auto qugar::at (Cont &cont, const index ind) -> decltype(cont[cont.size()])
 
template<class T >
constexpr T qugar::at (const std::initializer_list< T > cont, const index ind)
 
template<class T , std::size_t extent = std::dynamic_extent>
constexpr auto qugar::at (std::span< T, extent > spn, const index ind) -> decltype(spn[spn.size()])
 

Detailed Description

Utility functions.

Author
Pablo Antolin (pablo.nosp@m..ant.nosp@m.olin@.nosp@m.epfl.nosp@m..ch)
Date
2025-01-21