Speaker and organizer of C++ conferences
A leader in C++ standardization committee
Israeli NB Chair, LEWG Chair
Hamakor
Windows & Azure Security Group
Develop AI tools for C++ Engineers
* Info is from my point of view
Reducing UB
Hardening
the library &
the language
Reduce boilerplate
Language is more expressive & accessible
Keep Zero-overhead
More compile-time
This talk: https://slides.com/d/3xvcfGk/live
Standard
auto a = 42 ;
0b101010
a
int
Compiler
❌ Checks
▶️ Run
Snippets
📚
Libraries
🐞Debug, Logs & Error Utils
⚠️ Warnings
📖 Documentation
0b101010
a
int
0b101010
a
const char *
0b0
a
const char *
This talk: https://slides.com/d/3xvcfGk/live
Static Reflection
int main() {
constexpr auto r = ^^int;
typename[:r:] x = 42;
}int main() {
auto r = ^^int;
typename[:r:] x = 42;
}int main() {
constexpr auto r = ^^int;
constexpr typename[:r:] x = 42;
}Inspect your program
at compile time
From: Welcome to v1.0 of the meta::[[verse]]!
(CppNow2024, CoreC++2024, CppUnderSea2024, ACCU2024, CppCon2025, CppOnSea2025)
#include <experimental/meta>
struct S;
consteval {
define_aggregate(^^S, {
data_member_spec(^^int, {.name = "i"}),
data_member_spec(^^char, {.name = "c"})
});
}
int main() {
constexpr S s1{4, '2'};
static_assert(s1.i == 4 && s1.c == '2');
S s2;
}* Code Generation
https://godbolt.org/z/WoTszsYhf
* some
define_aggregate
#include <string>
#include <type_traits>
// Define type list
template<typename... Ts>
struct type_list {};
// Define concat
template<typename... Lists>
struct concat;
template<typename... Ts, typename... Us, typename... Rest>
struct concat<type_list<Ts...>, type_list<Us...>, Rest...>
: concat<type_list<Ts..., Us...>, Rest...> {};
template<typename T>
struct concat<T> {
using type = T;
};
template<typename... Lists>
using concat_t = typename concat<Lists...>::type;
// Define filter (could be nicer using P2841)
template<typename L, template<typename> typename Pred>
struct filter;
template<typename... Ts, template<typename> typename Pred>
struct filter<type_list<Ts...>, Pred> {
using type = concat_t<
std::conditional_t<
Pred<Ts>::value,
type_list<Ts>,
type_list<>
>...
>;
};
// Define filter_t
template<typename L, template<typename> typename Pred>
using filter_t = typename filter<L, Pred>::type;
// --- Usage ---
// Define a predicate
template<typename T>
struct is_trivial : std::is_trivially_copyable<T>
{};
using my_types = type_list<int, std::string, double>;
using my_filtered_types = filter_t<my_types, is_trivial>;
static_assert(std::is_same_v<my_filtered_types, type_list<int, double>>);Cleaner meta-programming
type_list<int, double>
* P2841: (concept & variable-template template-params) (C++26)
Corentin Jabot, Gašper Ažman, James Touton, Hubert Tong
#include <meta>
using namespace std::meta;
consteval auto filter(std::vector<info> types, auto pred) {
std::erase_if(types, [&](info t){ return !pred(t); });
return substitute(^^std::tuple, types);
}
constexpr auto is_trivial = [](info t){ return is_trivially_copyable_type(t); };
constexpr auto my_types = std::initializer_list<info>{^^int, ^^std::string, ^^double};
using my_filtered_types = [:filter(my_types, is_trivial):];
static_assert(std::is_same_v<my_filtered_types, std::tuple<int, double>>);type_list<int, std::string, double>
https://godbolt.org/z/vP9ze6eo9
int main() {
constexpr auto r = ^^int;
typename[:r:] x = 42;
}👋
👋
👋
Compiler
❌ Checks
📚
Libraries
📖 Documentation
▶️ Run
Snippets
https://godbolt.org/z/vP9ze6eo9
Welcome to v1.0 of the meta::[[verse]]!
#include <stdexcept>
consteval void should_not_be_called() {
throw std::logic_error("should not be called!");
}
constexpr int is_issues() {
try {
should_not_be_called();
} catch (...) {
return 1;
}
return 0;
}👋
👋
🐞Debug, Logs & Error Utils
static_assert(is_issues() == 0);https://compiler-explorer.com/z/6P7aMo7vT
https://compiler-explorer.com/z/h1Tff5d3P
👋
👋
Compiler
❌ Checks
📚
Libraries
Specify program's invariants
int div_N_set(const int a, const int b)
pre ((b > 0) && (a > 0) && (a % b == 0))
post (r: r * b == a)
{
contract_assert(a >= b);
return a / b;
}int r = div_N_set(5,6);int div_N_set(const int a, const int b)
pre ((b > 0) && (a > 0) && (a % b == 0))
{
return a / b;
}int div_N_set(const int a, const int b)
pre ((b > 0) && (a > 0) && (a % b == 0))
post (r: r * b == a)
{
return a / b;
}int div_N_set(const int a, const int b)
{
return a / b;
}https://godbolt.org/z/Ts9KEohzb
Build Modes
int div_N_set(const int a, const int b)
pre (...)
post (...)
{
}
int main() {
auto r = div_N_set(4,5);
}int div_N_set(const int a, const int b)
pre (...)
post (...)
{
std::vector<int> v = {};
v.front();
}
int main() {
auto r = div_N_set(4,5);
}Customize behaviour
void handle_contract_violation(const std::contracts::contract_violation&){
...
}https://godbolt.org/z/W68rj6ndj
https://contracts.efcs.ca/
int div_N_set(const int a, const int b)
pre ((b > 0) && (a > 0) && (a % b == 0))
post (r: r * b == a)
{
contract_assert(a >= b);
return a / b;
}👋
👋
https://godbolt.org/z/W68rj6ndj
▶️ Run
Snippets
🐞Debug, Logs & Error Utils
⚠️ Warnings
📖 Documentation
#include <print>
#include <execution>
namespace ex = std::execution;
int main()
{
// Get a scheduler
auto sched = ex::get_parallel_scheduler();
// Build a sender chain
auto PowerTwo = [](int i) { return i*i; };
auto TimesTwo = [](int i) { return i*2; };
sender auto work = ex::when_all(ex::on(sched, ex::just(2)|ex::then(PowerTwo)),
ex::on(sched, ex::just(1)|ex::then(TimesTwo)));
// Compose & launch the work
auto [x,y] = ex::sync_wait(std::move(work)).value(); // Wait till all finish
print("%d %d", x, y); // 4 2
}https://godbolt.org/z/96hcW5KT7
https://godbolt.org/z/96hcW5KT7
#include <print>
#include <execution>
namespace ex = std::execution;
int main()
{
// Get a scheduler
auto sched = ex::get_parallel_scheduler();
// Build a sender chain
auto PowerTwo = [](int i) { return i*i; };
auto TimesTwo = [](int i) { return i*2; };
sender auto work = ex::when_all(ex::on(sched, ex::just(2)|ex::then(PowerTwo)),
ex::on(sched, ex::just(1)|ex::then(TimesTwo)));
// Compose & launch the work
auto [x,y] = ex::sync_wait(std::move(work)).value(); // Wait till all finish
print("%d %d", x, y); // 4 2
}#include <print>
#include <execution>
namespace ex = std::execution;
int main()
{
// Get a scheduler
auto sched = ex::get_parallel_scheduler();
// Build a sender chain
auto PowerTwo = [](int i) { return i*i; };
auto TimesTwo = [](int i) { return i*2; };
sender auto work = ex::when_all(ex::on(sched, ex::just(2)|ex::then(PowerTwo)),
ex::on(sched, ex::just(1)|ex::then(TimesTwo)));
// Compose & launch the work
auto [x,y] = ex::sync_wait(std::move(work)).value(); // Wait till all finish
print("%d %d", x, y); // 4 2
}https://godbolt.org/z/96hcW5KT7
struct my_receiver {
using receiver_concept = std::execution::receiver_t;
void set_value(auto&&... values) && noexcept {
// Logic when work completes successfully
}
void set_error(auto&& error) && noexcept {
// Logic when work fails
}
void set_stopped() && noexcept {
// Logic when work is cancelled (clean up, return 503, log, etc.)
}
};User Customize: receiver, sender, schedule (in scheduler) "connect" (in sender) "start" (in operation state), "get_env" (in sender/receiver, including allocators)
https://godbolt.org/z/96hcW5KT7
👋
👋
👋
👋
int main()
{
// Get scheduler
auto sched = get_parallel_scheduler();
// Build a sender chain
sender auto work = ex::when_all( ex::on( sched, ex::just(2) | ex::then([](int i) { return i*i; } )),
ex::on( sched, ex::just(1) | ex::then([](int i) { return i*2; } )));
// Launch
auto [x,y] = sync_wait(std::move(work)).value(); // Wait till all finish
print("%d %d", x, y); // 4 2
}Compiler
❌ Checks
▶️ Run
Snippets
📚
Libraries
🐞Debug, Logs & Error Utils
⚠️ Warnings
📖 Documentation
https://godbolt.org/z/96hcW5KT7
#include <immintrin.h> // SSE intrinsics, run on x86-64
int main()
{
__m128 a = _mm_set_ps(4.0f, 3.0f, 2.0f, 1.0f);
__m128 b = _mm_set_ps(8.0f, 7.0f, 6.0f, 5.0f);
__m128 c = _mm_add_ps(a, b); // [6.0f, 8.0f, 10.0f, 12.0f]
}https://godbolt.org/z/Tfo87fW4K
#include <immintrin.h> // SSE intrinsics, run on x86-64
int main()
{
__m128 a = _mm_set_ps(4.0f, 3.0f, 2.0f, 1.0f);
__m128 b = _mm_set_ps(8.0f, 7.0f, 6.0f, 5.0f);
auto c = a + b; // [6.0f, 8.0f, 10.0f, 12.0f]
}int main() // x86-64
{
stdx::simd<float> a([](int i) { return float(i + 1); }); // [1,2, 3, 4]
stdx::simd<float> b([](int i) { return float(i + 5); }); // [5,6, 7, 8]
auto c = a + b; // [6,8,10,12]
}int main() // x86-64
{
stdx::simd<char> a([](char i) { return char(i + 1); }); // [1, 2, ..., 16]
stdx::simd<char> b([](char i) { return char(i + 5); }); // [5, 6, ..., 20]
auto c = a + b; // [6, 8, ..., 36]
}int main() // x86-64
{
stdx::simd<char> a([](char i) { return char(i + 1); });
stdx::simd<char> b([](char i) { return char(i + 5); });
auto c = a + b;
}int main() // x86-64
{
stdx::simd<float> a([](int i) { return float(i + 1); });
stdx::simd<float> b([](int i) { return float(i + 5); });
auto c = a + b;
}Compiler
❌ Checks
▶️ Run
Snippets
📚
Libraries
📖 Documentation
https://godbolt.org/z/Tfo87fW4K
int main() // x86-64
{
stdx::simd<float> a([](int i) { return float(i + 1); }); // [1,2, 3, 4]
stdx::simd<float> b([](int i) { return float(i + 5); }); // [5,6, 7, 8]
auto c = a + b; // [6,8,10,12]
}👋
int main()
{
std::vector matrix = {1, 2, 3,
4, 5, 6};
std::vector vector = {1, 2, 3};
std::vector result = {0, 0};
auto mat_sp = stdex::mdspan(matrix.data(), 2, 3);
auto vec_sp = stdex::mdspan(vector.data(), 3);
auto res_sp = stdex::mdspan{result.data(), 2);
// Update data using the mdspan view
for(size_t i=0; i != mat_sp.extent(0); i++)
for(size_t j=0; j != mat_sp.extent(1); j++)
res_sp[i] += mat_sp[i, j]*vec_sp[j];
}|1 2| |1| |0|
|3 4| |2| |0|
|5 6| |3||14|
|32|
int main()
{
std::vector matrix = {1, 2, 3,
4, 5, 6};
std::vector vector = {1, 2, 3};
std::vector result = {0, 0};
auto mat_sp = stdex::mdspan(matrix.data(), 2, 3);
auto vec_sp = stdex::mdspan(vector.data(), 3);
auto res_sp = stdex::mdspan{result.data(), 2);
std::linalg::matrix_vector_product(mat, vec, res);
}(mdspan only) https://godbolt.org/z/qdGr4szoh
Compiler
❌ Checks
📚
Libraries
📖 Documentation
👋
int main()
{
std::vector matrix = {1, 2, 3,
4, 5, 6};
std::vector vector = {1, 2, 3};
std::vector result = {0, 0};
auto mat_sp = stdex::mdspan(matrix.data(), 2, 3);
auto vec_sp = stdex::mdspan(vector.data(), 3);
auto res_sp = stdex::mdspan{result.data(), 2);
std::linalg::matrix_vector_product(mat, vec, res);
}P3471: (Standard library hardening) Konstantin Varlamov, Louis Dionne
constexpr reference operator[](size_type idx) const;Hardened Ppreconditions: idx < size() is true.
bool is_debugger_present() noexcept;
void breakpoint_if_debugging() noexcept;void printValue(int val) { // 2
std::cout << val << std::endl; // 3
}
int main() {
int x; // Uninitialized
printValue(x); // 1
}preconditions: idx < size() is true.
Reflection & Metaprogramming
- Static Reflection
- Expansion statements
Syntax
- Placeholder variables _
- Pack indexing
- = delete("reason")
- Variadic friends
- #embed
- Oxford variadic comma
Safety & UB Removal
- Erroneous behavior
- EB for uninitialized reads + [[indeterminate]]
- Disallow returning reference to temporary
- Delete pointer to incomplete type is ill-formed
- Trivial infinite loops are not UB
- Observable checkpoints (+ lib)
Other extensions & fixes
- Trivial unions
- Unevaluated strings
- @, $, ` in basic character set
- User-generated static_assert messages
- Static storage for braced initializers
- Template parameter initialization
- Fold expression constraint ordering
- Brace elision clarification
- Diagnosing preprocessor errors
- Module declaration cleanup (3 papers)
- concepts and variadic template template parameters
- Attributes for structured bindings, as condition, intoduce a pack
Constexpr
- Constexpr cast from void*, placement new, structured binding
- Constexpr virtual inheritance
- Constexpr exceptions (+ lib)
https://cppreference.com/cpp/26
Major New Libraries
- std::execution (senders/receivers)
- std::simd (SIMD)
- std::meta (reflection metafunctions)
- std::linalg (linear algebra)
- std::inplace_vector
- std::hive
- std::polymorphic & std::indirect
- Hazard pointers
- RCU (Read-Copy-Update)
- std::text_encoding
- Contracts (lib support)
Utilities & additions
- approximatly_sized_range & ranges::reserve_hint
- parallel range algorithms
- std::debugging
- std::submdspan
- std::type_order (lib extension supporting standard type ordering)
- std::is_within_lifetime
- Saturation arithmetic
- Standard library hardening
Algorithms & Constexpr
- constexpr all the containers
- constexpr std::exceptions
- Constexpr stable sorting
- More constexpr <cmath> and <complex>
- ADL-proof std::projected
- <charconv> success/failure testing
Additional Ranges
- std::views::concat
- std::views::chache_latest
- std::views::indices
- std::ranges::as_input_view
- std::ranges::generate_random
Fixes & extensions
- std::optional<T&>
- std::weak_ptr as unordered key
- Heterogeneous associative container overloads
- Native file stream handles
- Hashing for std::chrono types
- New SI ratio prefixes
- std::to_string uses std::format
- Formatting pointers
- Type-checking format args
- basic_format_arg::visit()
- std::variant::visit() member
- interfacing stringstream and string_view
- interfacing bitset and string_view
https://cppreference.com/cpp/26
Subsets of the language that enforce safety rules
* Disclaimer - non of the above is final yet
Networking, Units and Quantities, cstring_view
floating points, BitInt<N>, Pattern matching?
Language that allows humans to communicate instructions to a computer
and to other humans
and to AI :)
auto a = 42 ;
0b101010
a
int
Standard
Compiler
❌ Errors
▶️ Run
Snippets
📚
Libraries
🐞Debug, Logs & Error Utils
⚠️ Warnings
📖 Documentation
Final ratification expected in late 2026
The future of C++ is safe, simple, and powerful
Become a contributor!
Hana Dusíková, Dan Katz, Hui Xie, Dietmar Kühl, Robert Leahy, Lucian Radu Teodorescu
Start experimenting TODAY!
You can help implementations land earlier!
Thank you for listening! 🤗
Inbal Levi
linkedin/inballevi