C++ Logo

std-proposals

Advanced search

Forward declaration of concepts

From: Omer Rosler <omer.rosler_at_[hidden]>
Date: Sun, 21 Mar 2021 16:40:56 +0200
Is there a reason forward declaration of concepts are not allowed?

I wanted such feature in the following snippet:

```c++
template<typename T>
concept tag_type;
//Use the concept in a template declaration, when instantiated, the
concept definition will be avilable
template<template<tag_type> typename ArgsType, template<ArgsType...>
typename Templ>
struct template_ {};
template<typename T>
struct is_tag_impl : std::false_type {};
template<template<tag_type> typename ArgsType, template<ArgsType...>
typename Templ>
struct is_tag_impl<template_<ArgsType, Templ>> : std::true_type {};

template<typename T>
concept tag_type = is_tag_impl<T>::value;



```

Received on 2021-03-21 09:41:10