1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03
10
11// <random>
12
13#include <random>
14
15template<class Int>
16struct G {
17 using result_type = Int;
18 result_type operator()();
19 static constexpr result_type min() { return 0; }
20 static constexpr result_type max() { return 255; }
21};
22
23void test(std::uniform_real_distribution<double> dist)
24{
25 G<int> badg;
26 G<unsigned> okg;
27
28 dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
29 dist(okg);
30}
31

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of libcxx/test/libcxx/numerics/rand/rand.dist/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp