Header file range/v3/utility/semiregular.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

#include <range/v3/utility/get.hpp>

#include <range/v3/detail/optional.hpp>

namespace ranges
{
    inline namespace v3
    {
        template <typename T>
        struct semiregular;
        
        template <typename T>
        using semiregular_t = meta::if_<SemiRegular<T>, T, semiregular<T>>;
        
        template <typename T, bool IsConst = false>
        using semiregular_ref_or_val_t = meta::if_<SemiRegular<T>, meta::if_c<IsConst, T, reference_wrapper<T>>, reference_wrapper<meta::if_c<IsConst, semiregular<T>const, semiregular<T>>>>;
        
        template <typename T>
        T& get(meta::id_t<semiregular<T>>& t);
        
        template <typename T>
        T const& get(meta::id_t<semiregular<T>>const& t);
        
        template <typename T>
        T&& get(meta::id_t<semiregular<T>>&& t);
    }
}

Class template ranges::v3::semiregular<T>

template <typename T>
struct semiregular
{
    semiregular() = default;
    
    semiregular(T f);
    
    template <typename ... Args>
    semiregular(in_place_t, Args&&... args);
    
    T& get();
    
    T const& get() const;
    
    semiregular& operator=(T const& t);
    
    semiregular& operator=(T&& t);
    
    operator T&();
    
    operator T const&() const;
    
    template <typename ... Args>
    decltype(std::declval<T&>()(std::forward<Args>(args)...)) operator()(Args&&... args);
    
    template <typename ... Args>
    decltype(std::declval<T const&>()(std::forward<Args>(args)...)) operator()(Args&&... args) const;
};

@{