mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 05:28:01 +00:00
be7ce4110e
This reverts commit e96515433d
.
22 lines
378 B
C++
22 lines
378 B
C++
// Test for concepts support. Not just the language feature; also headers.
|
|
#include <iostream>
|
|
#include <ranges>
|
|
#include <vector>
|
|
|
|
|
|
template<typename T>
|
|
concept Foo = std::ranges::input_range<T>;
|
|
|
|
|
|
template<Foo F> auto foo(F const &r)
|
|
{
|
|
return std::distance(std::begin(r), std::end(r));
|
|
}
|
|
|
|
|
|
int main()
|
|
{
|
|
std::vector<int> const v{1, 2, 3};
|
|
std::cout << foo(v) << '\n';
|
|
}
|