chore(tests): consistent captures

This commit is contained in:
Christian Clason 2023-12-24 12:52:21 +01:00
parent 17fae3f4a3
commit 10dd49958c
60 changed files with 872 additions and 873 deletions

View file

@ -1,14 +1,14 @@
template <class T, class U>
concept Derived = std::is_base_of<U, T>::value;
// ^ keyword
// ^ type.definition
// ^ @keyword
// ^ @type.definition
template<typename T>
concept Hashable = requires(T a) {
// ^ keyword
// ^ parameter
// ^ type
// ^ @keyword
// ^ @parameter
// ^ @type
{ std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
typename CommonType<T, U>; // CommonType<T, U> is valid and names a type
{ CommonType<T, U>{std::forward<T>(t)} };
@ -18,5 +18,5 @@ concept Hashable = requires(T a) {
template<typename T>
requires requires (T x) { x + x; } // ad-hoc constraint, note keyword used twice
// ^ keyword
// ^ @keyword
T add(T a, T b) { return a + b; }

View file

@ -1,19 +1,19 @@
#include <iostream>
#include <cstdlib>
// ^ include
// ^ string
// ^ @include
// ^ @string
auto main( int argc, char** argv ) -> int
// ^ type.builtin
// ^ parameter
// ^ type.builtin
// ^ type.builtin
// ^ operator
// ^ @type.builtin
// ^ @parameter
// ^ @type.builtin
// ^ @type.builtin
// ^ @operator
{
std::cout << "Hello world!" << std::endl;
// ^ punctuation.delimiter
// ^ @punctuation.delimiter
return EXIT_SUCCESS;
// ^ keyword.return
// ^ constant
// ^ @keyword.return
// ^ @constant
}