Header file range/v3/utility/any.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

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

namespace ranges
{
    inline namespace v3
    {
        struct bad_any_cast
        : std::bad_cast
        {
            virtual const char* what() const noexcept override;
        };
        
        template <typename T>
        meta::if_c<std::is_reference<T>()||Copyable<T>(), T> any_cast(any&);
        
        template <typename T>
        meta::if_c<std::is_reference<T>()||Copyable<T>(), T> any_cast(any const&);
        
        template <typename T>
        meta::if_c<std::is_reference<T>()||Copyable<T>(), T> any_cast(any&&);
        
        template <typename T>
        T* any_cast(any*) noexcept;
        
        template <typename T>
        T const* any_cast(any const*) noexcept;
        
        struct any
        {
            any() noexcept = default;
            
            template <typename TRef, typename T = detail::decay_t<TRef>, int _concept_requires_109 = 42, typename std::enable_if<(_concept_requires_109==43)||(Copyable<T>()&&!Same<T, any>()), int>::type=0>
            any(TRef&& t);
            
            any(any&&) noexcept = default;
            
            any(any const& that);
            
            any& operator=(any&&) noexcept = default;
            
            any& operator=(any const& that);
            
            template <typename TRef, typename T = detail::decay_t<TRef>, int _concept_requires_124 = 42, typename std::enable_if<(_concept_requires_124==43)||(Copyable<T>()&&!Same<T, any>()), int>::type=0>
            any& operator=(TRef&& t);
            
            void clear() noexcept;
            
            bool empty() const noexcept;
            
            std::type_info const& type() const noexcept;
            
            void swap(any& that) noexcept;
        };
    }
}