C++ features by examples
17.cpp File Reference

C++17. More...

#include <bits/stdc++.h>
Include dependency graph for 17.cpp:

Go to the source code of this file.

Classes

struct  template_struct< T >
 template with type float by default More...
 
struct  B< n >
 
struct  my_integer_sequence< seq >
 

Namespaces

namespace  outer_namespace
 
namespace  outer_namespace::qualified_nested_namespace
 Before: namespace outer_namespace { namespace nested_namespace { } }.
 

Functions

constexpr pair deducted_pair (1, 2.3)
 pair<int, double> p(1, 2.3); More...
 
constexpr tuple deducted_tuple (4, 2, 2.5)
 auto t = make_tuple(4, 3, 2.5); More...
 
deque deduction_guide1_queue (int_vector.begin(), int_vector.end())
 deduction_guides More...
 
vector deduction_guide1_vector (int_vector.begin(), int_vector.end())
 deduced vector<int> More...
 
void deduction_guides_17 ()
 
tuple< int, int > foo_tuple ()
 
constexpr int const_inc (int n)
 
void capture_this_by_value ()
 
void lambda_17 ()
 
void threads_17 ()
 
void references_17 ()
 
template<typename... Args>
constexpr bool folding_and (Args... args)
 
template<typename... Args>
constexpr auto folding_sum (Args... args)
 
void folding_demo ()
 
void structured_bindings ()
 
void conditional_with_init ()
 
int foo ()
 
void test_attr ()
 
constexpr int const_if ()
 if More...
 
void types_17 ()
 
void map_demo ()
 
void variant_demo ()
 
void clamp_demo ()
 
void dynamic_memory_17 ()
 
void string_view_demo ()
 
int main ()
 

Variables

template_struct template_arg_deduction {1}
 deducted <int> More...
 
vector< int > int_vector = {1, 2, 3, 4}
 
deque deduction_guide2_queue {int_vector.cbegin(), int_vector.cend()}
 deduced deque<vector<int> :: iterator> More...
 
array deduction_guide_array {1, 2, 3, 4}
 deduction_guides More...
 
vector deduction_guide2_vector {int_vector.begin(), int_vector.end()}
 deduced vector<vector<int> :: iterator> More...
 
B< 5 > b1
 
B< 'a'> b2
 
auto seq = my_integer_sequence<0, 1, 2>()
 auto seq = integer_sequence<int, 0, 1, 2>(); More...
 
auto identity = [](int n) constexpr { return n; }
 
auto can_be_constexpr1 = [](auto a) { return a; }
 
auto can_be_constexpr2 = [](int(*fp)(int), auto a) { return fp(a); }
 
auto non_const = [](auto a) {static int s; return a; }
 
constexpr int(* inc )(int) = const_inc
 
int outer_namespace::qualified_nested_namespace::in_qualified_nested_namespace
 
static char char_u8 = u8'x'
 character_literal More...
 
int inline_var
 inline More...
 

Detailed Description

C++17.

Definition in file 17.cpp.