Недавно работы комитета по стандартизации WG21 были завершены, и документ-черновик C++17 был отправлен на рассмотрение в Международную организацию по стандартизации (ISO). С этого момента технически можно считать, что стандарт C++17 у нас есть. Если вы ещё ознакомились с принятыми изменениями, то сейчас для этого самое время. В докладе будет сделан обзор нововведений. Рассмотрено текущее состояние дел у популярных компиляторов с поддержкой С++17
Работа с реляционными базами данных в C++corehard_by
Поговорим в первую очередь о библиотеках, которые унифицируют работу с различными БД: Oracle, MSSQL, Postgres, MySQL и др. Я поделюсь своим опытом работы с некоторыми из них. А также посмотрим, что может нас ожидать в будущем в плане работы с SQL базами данных.
How to make a large C++-code base manageablecorehard_by
My talk will cover how to work with a large C++ code base professionally. How to write code for debuggability, how to work effectively even due the long C++ compilation times, how and why to utilize the STL algorithms, how and why to keep interfaces clean. In addition, general convenience methods like making wrappers to make the code less error prone (for example ranged integers, listeners, concurrent values). Also a little bit about common architecture patterns to avoid (virtual classes), and patterns to encourage (pure functions), and how std::function/lambda functions can be used to make virtual classes copyable.
Дмитрий Демчук. Кроссплатформенный краш-репортSergey Platonov
Доклад будет посвящен возможностям библиотеки Google Breakpad по созданию краш-репорта. Посмотрим как это работает изнутри.
На примерах будут рассмотрены способы интеграции библиотеки на разных платформах Windows, Linux, Max OS.
Работа с реляционными базами данных в C++corehard_by
Поговорим в первую очередь о библиотеках, которые унифицируют работу с различными БД: Oracle, MSSQL, Postgres, MySQL и др. Я поделюсь своим опытом работы с некоторыми из них. А также посмотрим, что может нас ожидать в будущем в плане работы с SQL базами данных.
How to make a large C++-code base manageablecorehard_by
My talk will cover how to work with a large C++ code base professionally. How to write code for debuggability, how to work effectively even due the long C++ compilation times, how and why to utilize the STL algorithms, how and why to keep interfaces clean. In addition, general convenience methods like making wrappers to make the code less error prone (for example ranged integers, listeners, concurrent values). Also a little bit about common architecture patterns to avoid (virtual classes), and patterns to encourage (pure functions), and how std::function/lambda functions can be used to make virtual classes copyable.
Дмитрий Демчук. Кроссплатформенный краш-репортSergey Platonov
Доклад будет посвящен возможностям библиотеки Google Breakpad по созданию краш-репорта. Посмотрим как это работает изнутри.
На примерах будут рассмотрены способы интеграции библиотеки на разных платформах Windows, Linux, Max OS.
One definition rule - что это такое, и как с этим житьPlatonov Sergey
В докладе будет разобрано, что-же такое ODR, какие ошибки могут быть из-за нарушения этого правила. Также будет представлен Proof-of-concept утилиты на базе clang tooling по автоматическому поиску таких ошибок.
1. what is the different unbuffered and buffered channel?
2. how to implement a job queue in golang?
3. how to stop the worker in a container?
4. Shutdown with Sigterm Handling
5. Canceling Workers without Context
6. Graceful shutdown with worker
7. How to auto-scaling build agent?
8. How to cancel the current Job?
Антон Наумович, Система автоматической крэш-аналитики своими средствамиSergey Platonov
В докладе будет рассмотрена система контроля качества с помощью снятия и анализа крэшдамп-файлов (применительно в первую очередь к системе Windows). Будет представлена архитектура и инструментарий для организации автоматического сбора и анализа крэшдамп-файлов, снимаемых в момент возникновения проблем в приложениях (падения, зависания, превышение потребления ресурсов – памяти, файловых дескрипторов и т.д.)
4Developers 2018: Evolution of C++ Class Design (Mariusz Łapiński)PROIDEA
Since the beginnings of C++, classes are the basic building block of any self-respecting application. The combination of data and its relevant functionality heavily impacts the way we modularize the program, design APIs, construct and reuse the code - think of software in general.
In the previous era, C++ was a hammer for every nail, providing secure high-level abstractions without sacrifice of the superior performance. Yet during the past decades, competing technologies dethroned it out of many domains. As the language evolved to prevail its principal advantages, so did the way classes are programmed.
I am pleased to invite you to a speech about code construction and programming techniques used in programs and libraries now and then. Expect a lot of code samples!
HKG15-207: Advanced Toolchain Usage Part 3
---------------------------------------------------
Speaker: Ryan Arnold, Maxim Kuvyrkov, Will Newton, Yvan Roux
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
This session is a continuation of the Advanced Toolchain Usage Part 1 & 2 presentations given at LCU14. Parts 3 and 4 will cover a variety of topics, such as: Linker tips and tricks, adding symbol versioning interfaces to a system library, debugging the dynamic linker, debugging applications that use malloc, gcc attributes, manually constructing a backtrace on arm & Aarch64, how to add lightweight debugging to your program, how to use a signal handler appropriately, and TLS Models on Aarch64 and when to use them.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250788
Video: https://www.youtube.com/watch?v=EhNqFCN0YJ0
Etherpad: http://pad.linaro.org/p/hkg15-207
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Не так давно Гор Нишанов представил свой доклад: C++ Coroutines a negative overhead abstraction. В этом докладе Гор упомянул, что предложенный дизайн корутин позволяет их использовать практически в любых окружениях, в том числе и с "бедным" C++ рантаймом.
Я решил попробовать запустить корутины в следующих окружениях: обычное приложение, драйвер ОС Windows, EFI приложение. Только в одном из этих окружений есть полноценный C++ рантайм и поддержка исключений, в остальных ничего этого нет. Более того, EFI приложение вообще выполняется до старта ОС.
Я хочу рассказать о том, как мне удалось запустить корутины в этих окружениях, поговорим о том, какие проблемы существуют в асинхронном системном программировании и как их можно обойти.
C++ Code as Seen by a Hypercritical ReviewerAndrey Karpov
We all do code reviews. Who doesn't admit this – does it twice as often. C++ code reviewers look like a sapper. .. except that they can make a mistake more than once. But sometimes the consequences are painful . Brave code review world.
Fuzzing is a software testing technique that involves providing invalid, unexpected, or random data to the inputs of a computer program. The presentation covers types of fuzzers and describes how they work. We will write and run a real fuzzer. Also it shows how fuzzers can guess correct CRC checksums, help with regression testing and find logical bugs in programs. Finally, it summarizes fuzzing usage at Google.
Из презентации вы узнаете:
про большинство утилит из арсенала Go, предназначенных для оптимизации производительности;
— как и когда их (утилиты) использовать, а также мы посмотрим как они устроены внутри;
— про применимость linux утилиты perf для оптимизации программ на Go.
Кроме того, устроим небольшой crash course, в рамках которого поэтапно соптимизируем несколько небольших программ на Go с использованием вышеперечисленных утилит.
Presentation of features already voted into C++20 Standard Draft in Toronto, Albuquerque, and Jacksonville ISO C++ Committee Meetings as well as the overview of other really promising proposals that have high chances to arrive in C++20.
Just how different is "Modern C++" from "legacy C++"? Is my codebase ready for C++17? Do I need a full rewrite of my app to modernize my code? If you're looking for answers to some of these questions, join us for a session on how to effectively leverage modern C++17 features in your existing C++ projects; and no, you don't need to rewrite your app.
One definition rule - что это такое, и как с этим житьPlatonov Sergey
В докладе будет разобрано, что-же такое ODR, какие ошибки могут быть из-за нарушения этого правила. Также будет представлен Proof-of-concept утилиты на базе clang tooling по автоматическому поиску таких ошибок.
1. what is the different unbuffered and buffered channel?
2. how to implement a job queue in golang?
3. how to stop the worker in a container?
4. Shutdown with Sigterm Handling
5. Canceling Workers without Context
6. Graceful shutdown with worker
7. How to auto-scaling build agent?
8. How to cancel the current Job?
Антон Наумович, Система автоматической крэш-аналитики своими средствамиSergey Platonov
В докладе будет рассмотрена система контроля качества с помощью снятия и анализа крэшдамп-файлов (применительно в первую очередь к системе Windows). Будет представлена архитектура и инструментарий для организации автоматического сбора и анализа крэшдамп-файлов, снимаемых в момент возникновения проблем в приложениях (падения, зависания, превышение потребления ресурсов – памяти, файловых дескрипторов и т.д.)
4Developers 2018: Evolution of C++ Class Design (Mariusz Łapiński)PROIDEA
Since the beginnings of C++, classes are the basic building block of any self-respecting application. The combination of data and its relevant functionality heavily impacts the way we modularize the program, design APIs, construct and reuse the code - think of software in general.
In the previous era, C++ was a hammer for every nail, providing secure high-level abstractions without sacrifice of the superior performance. Yet during the past decades, competing technologies dethroned it out of many domains. As the language evolved to prevail its principal advantages, so did the way classes are programmed.
I am pleased to invite you to a speech about code construction and programming techniques used in programs and libraries now and then. Expect a lot of code samples!
HKG15-207: Advanced Toolchain Usage Part 3
---------------------------------------------------
Speaker: Ryan Arnold, Maxim Kuvyrkov, Will Newton, Yvan Roux
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
This session is a continuation of the Advanced Toolchain Usage Part 1 & 2 presentations given at LCU14. Parts 3 and 4 will cover a variety of topics, such as: Linker tips and tricks, adding symbol versioning interfaces to a system library, debugging the dynamic linker, debugging applications that use malloc, gcc attributes, manually constructing a backtrace on arm & Aarch64, how to add lightweight debugging to your program, how to use a signal handler appropriately, and TLS Models on Aarch64 and when to use them.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250788
Video: https://www.youtube.com/watch?v=EhNqFCN0YJ0
Etherpad: http://pad.linaro.org/p/hkg15-207
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Не так давно Гор Нишанов представил свой доклад: C++ Coroutines a negative overhead abstraction. В этом докладе Гор упомянул, что предложенный дизайн корутин позволяет их использовать практически в любых окружениях, в том числе и с "бедным" C++ рантаймом.
Я решил попробовать запустить корутины в следующих окружениях: обычное приложение, драйвер ОС Windows, EFI приложение. Только в одном из этих окружений есть полноценный C++ рантайм и поддержка исключений, в остальных ничего этого нет. Более того, EFI приложение вообще выполняется до старта ОС.
Я хочу рассказать о том, как мне удалось запустить корутины в этих окружениях, поговорим о том, какие проблемы существуют в асинхронном системном программировании и как их можно обойти.
C++ Code as Seen by a Hypercritical ReviewerAndrey Karpov
We all do code reviews. Who doesn't admit this – does it twice as often. C++ code reviewers look like a sapper. .. except that they can make a mistake more than once. But sometimes the consequences are painful . Brave code review world.
Fuzzing is a software testing technique that involves providing invalid, unexpected, or random data to the inputs of a computer program. The presentation covers types of fuzzers and describes how they work. We will write and run a real fuzzer. Also it shows how fuzzers can guess correct CRC checksums, help with regression testing and find logical bugs in programs. Finally, it summarizes fuzzing usage at Google.
Из презентации вы узнаете:
про большинство утилит из арсенала Go, предназначенных для оптимизации производительности;
— как и когда их (утилиты) использовать, а также мы посмотрим как они устроены внутри;
— про применимость linux утилиты perf для оптимизации программ на Go.
Кроме того, устроим небольшой crash course, в рамках которого поэтапно соптимизируем несколько небольших программ на Go с использованием вышеперечисленных утилит.
Presentation of features already voted into C++20 Standard Draft in Toronto, Albuquerque, and Jacksonville ISO C++ Committee Meetings as well as the overview of other really promising proposals that have high chances to arrive in C++20.
Just how different is "Modern C++" from "legacy C++"? Is my codebase ready for C++17? Do I need a full rewrite of my app to modernize my code? If you're looking for answers to some of these questions, join us for a session on how to effectively leverage modern C++17 features in your existing C++ projects; and no, you don't need to rewrite your app.
Just how different is "Modern C++" from "legacy C++"? Is my codebase ready for C++17? Do I need a full rewrite of my app to modernize my code? If you're looking for answers to some of these questions, join us for a session on how to effectively leverage modern C++17 features in your existing C++ projects; and no, you don't need to rewrite your app.
C++20 comes with some big new language features: modules, coroutines, concepts, spaceship, and many new libraries. But apart from all those, C++20 also offers many small language improvements, making C++ more powerful and expressive, but also safer and more consistent. This talk is an overview over all those smaller additions to the core language that will make your life easier. We will discuss much-needed improvements to existing facilities such as lambdas, CTAD, structured bindings, and initialisation, as well as brand-new language utilities that you may not yet have heard about!
LAS16-501: Introduction to LLVM - Projects, Components, Integration, InternalsLinaro
LAS16-501: Introduction to LLVM - Projects, Components, Integration, Internals
Speakers: Renato Golin
Date: September 30, 2016
★ Session Description ★
Deep dive into LLVM internals, middle/back-ends, libraries, sanitizers, linker, debugger and overall compilation process. The focus is to show how LLVM works under the hood, which is useful for GCC compiler engineers getting into LLVM development, as well as for other engineers to learn more about parts of the toolchain they’re not familiar with. This presentation also touches on frequent LLVM-specific errors, so GCC users may find useful, if they’re moving to LLVM.
★ Resources ★
Etherpad: pad.linaro.org/p/las16-501
Presentations & Videos: http://connect.linaro.org/resource/las16/las16-501/
★ Event Details ★
Linaro Connect Las Vegas 2016 – #LAS16
September 26-30, 2016
http://www.linaro.org
http://connect.linaro.org
I am Bernard. I am a C Programming Assignment Help Expert at programminghomeworkhelp.com. I hold a Ph.D. in Computer Science from, University of Leeds, UK. I have been helping students with their homework for the past 12 years. I solve assignments related to C Programming.
Visit programminghomeworkhelp.com or email support@programminghomeworkhelp.com.You can also call on +1 678 648 4277 for any assistance with C Programming assignments.
We have successfully created and continue developing PVS-Studio analyzer for C/C++ languages. Over the time, it became clear that many of the diagnostics that we have implemented are not related to a specific programming language, so we decided to apply our experience to another programming language, namely C#. In this article, we are talking about the analysis of Code Contracts project by Microsoft done by our C# analyzer
Debugging and Profiling C++ Template MetaprogramsPlatonov Sergey
Template metaprogramming is an emerging new direction in C++ programming for executing algorithms in compilation time. Despite all of its already proven benefits and numerous successful applications, it is yet to be accepted in industrial projects. One reason is the lack of professional software tools supporting the development of template metaprograms. A strong analogue exists between traditional runtime programs and compile-time metaprograms. This connection presents the possibility for creating development tools similar to those already used when writing runtime programs. This paper introduces Templight, a debugging framework that reveals the steps executed by the compiler during the compilation of C++ programs with templates. Templight’s features include following the instantiation chain, setting breakpoints, and inspecting metaprogram information. This framework aims to take a step forward to help template metaprogramming become more accepted in the software industry.
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...corehard_by
Использование сторонних библиотек в языке C++ никогда не было простым - необходимо было правильно собрать их, имея дело с различными системами сборки, но с появлением пакетного менеджера conan.io процесс стал намного проще, так что теперь осталось только сделать пакеты для нужным библиотек, и в этом поможет команда bincrafter-ов.
C++ CoreHard Autumn 2018. Actors vs CSP vs Tasks vs ... - Евгений Охотниковcorehard_by
На предыдущих конференциях C++ CoreHard автор доклада рассказывал про Модель Акторов и опыт ее использования в C++. Но Модель Акторов -- это далеко не единственный способ борьбы со сложностью при работе с многопоточностью. Давайте попробуем поговорить о том, что еще можно применить и как это может выглядеть в C++.
C++ CoreHard Autumn 2018. Знай свое "железо": иерархия памяти - Александр Титовcorehard_by
Если вам важна скорость работы ваших программ, то вы обязаны понимать, как работает ваше "железо". Современный процессор -- это сложное устройство, многие механизмы которого могут неочевидным образом влиять на скорость исполнения вашего кода. В докладе дается обзорное представление основных структур современного процессора и подробно рассматривается работа иерархии памяти. Будут освещены следующие темы: организация кэш-памяти, принцип локальности, предподкачка данных, нежелательное общее владение данными, а также программные техники для эффективной работы с памятью.
C++ CoreHard Autumn 2018. Информационная безопасность и разработка ПО - Евген...corehard_by
Информационная безопасность все больше из отдельной сферы плавно перетекает в разработку ПО. А значит «обычным» программистам приходится понимать те требования и терминологию, которые специалисты по безопасности уже давно знают и используют. CWE, CERT, MISRA, SAST– для «обычных» программистов это непонятные аббревиатуры. Поэтому в обзорном докладе мы попробуем рассказать простым языком об этих понятиях так, чтобы все разработчики начали уверенно ориентироваться в этой теме.
C++ CoreHard Autumn 2018. Заглядываем под капот «Поясов по C++» - Илья Шишковcorehard_by
Вот уже более двух лет мы создаём онлайн-специализацию по С++ на платформе Coursera. Её цель — обучить языку C++ с нуля до уровня, достаточного для решения практических задач, с которыми приходилось сталкиваться авторам в своей практике. В своём докладе я расскажу, как мы создаём наши онлайн-курсы, и уделю особое внимание техническим проблемам, которые нам пришлось решить в процессе создания автоматической системы проверки программ студентов.
C++ CoreHard Autumn 2018. Ускорение сборки C++ проектов, способы и последстви...corehard_by
В докладе обсуждаются способы улучшения времени сборки C++ проектов, опыт полученный в ходе ускорения сборки клиента и тулов World Of Tanks. Также описывается эффект, который они оказывают на организацию кодобазы (как позитивный, так и негативный) и затраты, которые необходимы для поддержки этих решений, т.к. не все они бесплатны. Методики, описываемые в докладе: ускорение линковки (Incremental Linking, Fastlink), ускорение компиляции(Include what you use, использование precompiled headers).
C++ CoreHard Autumn 2018. Метаклассы: воплощаем мечты в реальность - Сергей С...corehard_by
Доклад посвящён вопросам реализации пропозала Герба Саттера PR0707 (метаклассы в С++) за пределами компилятор - в виде отдельной утилиты. Будет продемонстрированы варианты использования метаклассов в реальной жизни, затронуты вопросы их реализации на базе Clang Frontend, а также возможные перспективы развития технологии и методики.
C++ CoreHard Autumn 2018. Что не умеет оптимизировать компилятор - Александр ...corehard_by
Все мы знаем, что компиляторы в настоящее время достаточно умные. И нам как программистам зачастую не нужно думать о каких-то незначительных оптимизациях - мы полагаемся на оптимизации компилятора. Что ж, настало время выяснить, действительно ли настолько компиляторы умны и узнать, в каких местах программист всё же (может быть) умнее.
C++ CoreHard Autumn 2018. Кодогенерация C++ кроссплатформенно. Продолжение - ...corehard_by
В докладе будет рассмотрена генерация кода при компиляции различных языковых конструкций, как простых, так и сложных, на различных платформах, как общераспространённых x86/x64, так и тех, которым уделяется меньше внимания: ARM, AVR. Также будут встречаться примеры для совсем экзотических процессоров вроде PowerPC и даже MicroBlaze. Основной упор будет делаться не на обработку данных, а именно на сопоставление различных конструкций кода с инструкциями целевых платформ.
C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...corehard_by
What do threads, atomic variables, mutexes, and conditional variables have in common? They are the basic building blocks of any concurrent application in C++, which are even for the experienced C++ programmers a big challenge. This massively changed with C++17 and change even more with C++20/23. What did we get with C++17, what can we hope for with C++20/23? With C++17, most of the standard template library algorithms are available in sequential, parallel, and vectorised variants. With the upcoming standards, we can look forward to executors, transactional memory, significantly improved futures and coroutines. To make it short. These are just the highlights from the concurrent and parallel perspective. Thus there is the hope that in the future C++ abstractions such as executors, transactional memory, futures and coroutines are used and that threads, atomic variables, mutexes and condition variables are just implementation details.
C++ CoreHard Autumn 2018. Обработка списков на C++ в функциональном стиле - В...corehard_by
Язык C++, претерпев долгую эволюцию, обрёл ряд черт, характерных для функциональной парадигмы: функции стали полноправными объектами, над которыми могут выполняться операции, а аппарат шаблонов позволяет проводить вычисления на типах на этапе компиляции. Математический фундамент этих двух главных аспектов составляют, соответственно, ламбда-исчисление и теория категорий. Расширение языка этими средствами способствовало реализации на языке C++ ряда инструментов, известных из функционального программирования. Некоторые из этих реализаций вошли в стандартную библиотеку (std::function, std::bind), другие - в сторонние библиотеки, в том числе в коллекцию библиотек Boost (functional, hana). Важную роль в арсенале функционального программирования играют операции свёртки и развёртки, которые очевиднее всего определяются для списков, но также естественным образом обобщаются на другие индуктивные и коиндуктивные структуры данных. Например, суммирование списка чисел можно представить себе как свёртку списка по операции сложения, а построение списка простых множителей заданного целого числа - как развёртку. Обобщения свёртки и развёртки известны как анаморфизмы и катаморфизмы. Также в функциональном программировании находит применение понятие гиломорфизма - композиция развёртки некоторого объекта в коллекцию с последующей свёрткой её в новый объект. В докладе продемонстрировано, что свёртки, развёртки и их композиции допускают довольно простую реализацию на языке C++.
C++ Corehard Autumn 2018. Обучаем на Python, применяем на C++ - Павел Филоновcorehard_by
Доклад посвящен часто используемому шаблону в моих проектах по анализу данных, когда обучение и настройка моделей происходят с использованием python, а вот их запуск в промышленное использование на языке C++. Предлагается рассмотреть несколько учебных примеров реализации такого подхода, от простой линейной регрессии до обработки изображений с помощью нейронных сетей.
C++ CoreHard Autumn 2018. Asynchronous programming with ranges - Ivan Čukićcorehard_by
This talk will be about the design and implementation of a reactive programming model inspired by ranges that allows easy implementation of asynchronous and distributed software systems by writing code that looks like a sequence of ordinary range transformations like filter, transform, etc. This programming model will be demonstrated along with the implementation of a simple asynchronous web service where the whole system logic is defined as a chain of range transformations.
C++ CoreHard Autumn 2018. Debug C++ Without Running - Anastasia Kazakovacorehard_by
Macros, templates, compile-time evaluation and code generation, reflection and metaclasses – C++ tends to hide the final code passed to the compiler under the tons of various names and aliases. Add here the preprocessor that shadows the actual running curve of your program with dozens of alternatives mixed in a non-trivial way. While this allows to avoid boilerplate code and reduce copy-paste and other errors, such an approach demands better tooling support to make the debugging process easier. To find an error in such a code, one has to continuously read-fix-run it and compare the results with some etalon, or to debug in order to find actual substitutions. But should you really wait until your code is run or even compiled to debug it? Or how to deal with the situations when the code can’t be run on the local machine? A text editor with code completion won’t help, while a smart IDE that “gets” your code can do a better job. In this talk we’ll see interesting approaches to solving cases like macro and typedef ‘debug’, understanding types when auto/decltype hide them, dealing with different code branches depending on the preprocessor’s pass-through, and other ideas. Some suggestions are already implemented as ready-to-use features in CLion and ReSharper C++, tools for C++ from JetBrains (that means I can show it in action), others are planned for the future. The aim of this talk is to share the workflows supported by the tools that can help C++ developers create better modern C++ code.
C++ CoreHard Autumn 2018. Полезный constexpr - Антон Полухинcorehard_by
В C++11 добавили новое ключевое слово - constexpr. Выглядит оно весьма невзрачно, да и на первый взгляд кажется, что смысла в нём маловато... Для чего же оно нужно, какие у него есть тайные супер способности и какую роль оно сыграет в дальнейшем развитии языка C++ - обо всём об этом мы и поговорим.
C++ CoreHard Autumn 2018. Text Formatting For a Future Range-Based Standard L...corehard_by
Text formatting has been a favorite problem of C++ library authors for a long time. The standard C++ iostreams have been criticized for being difficult to use due to their statefulness and slow due to runtime polymorphism. Despite its age, printf is still popular because of simplicity and speed. The Boost library offers two more alternatives, Boost.Format and Boost.LexicalCast. And finally, the P0645 standard proposal sponsored by Facebook is currently finding its way through the C++ committee. All these approaches are still firmly based on standard containers and iterators. But the Standard Library is changing radically with the advent of ranges, range adaptors and functional style programming in C++. Generating optimized code with metaprogramming is becoming standard fare. In this talk, I want to convince you that the combination of ranges with a bit of metaprogramming makes for a very elegant solution to the text formatting problem. We introduce a form of ranges with internal iteration, which are generating their elements one by one rather than exposing external iterators. We can use these generator ranges to represent the values to be formatted, conceptually turning them into lazily evaluated strings. These can be used just like regular strings are used today: in function returns; as standard algorithm input; embedded into other, equally lazily evaluated strings; and so on, before they are finally expanded for display. By choosing the right interfaces, we can optimize this expansion at compile-time, making it no less pretty to write, but more efficient to expand than any text formatting approaches that rely on format strings that must be parsed at runtime. I believe that this approach is the natural extension of a range-based future standard library to text formatting.
Исключительная модель памяти. Алексей Ткаченко ➠ CoreHard Autumn 2019corehard_by
Память в компьютере - это не только гигабайты оперативной памяти в слоте, но и занятная абстракция. В докладе мы рассмотрим, как можно эту абстракцию использовать необычным образом для моделирования других абстракций - регистровых файлов периферийных устройств. Доклад будет полезен не только embedded-разработчикам, но и, возможно, заставит переосмыслить свой взгляд на память.
Как помочь и как помешать компилятору. Андрей Олейников ➠ CoreHard Autumn 2019corehard_by
Как правило, можно положиться на то, что компилятор оптимизирует результирующий бинарный файл так, чтобы она работала максимально быстро. Но компилятор не знает на каких данных и на каком железе программа будет запущена. Плюс хотелось бы, чтобы компиляция занимала приемлемое время. Из-за этого результат может оказаться субоптимальным. Предлагаю на примерах для LLVM посмотреть как можно подсказать компилятору как оптимизировать программу и сделать результат лучше или хуже.
Мы напишем простейший веб-сервис из клиента и сервера на C++. На этом C++ часть закончится, и пойдет настройка окружения и инфраструктуры. Мы обеспечим детерминируемость сборки и прогона тестов. Облегчим последующее обновление зависимых библиотек. Автоматизируем статические проверки, верификацию кода, прогон тестов. Обеспечим доступность сервиса, настроим инфраструктуру, сбалансируем нагрузку, добавим автоматическое и ручное масштабирование. И под конец мы настроим continious delivery таким образом, что код будет на продакшене через 5 минут после реквеста, при этом даже невалидные изменения и ошибки программиста не смогут повлиять на его работу.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
11. 10
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
NEW AUTO RULES FOR DIRECT-LIST-INITIALIZATION(N3922)
GCC: 5.0 Clang: 3.8 MSVS: 14.0
direct list initialization: T object {arg1, arg2, ...};
copy list initialization: T object = {arg1, arg2, ...};
auto a = { 42 }; // std::initializer_list<int>
auto b { 42 }; // now int, before was std::initializer_list<int>
auto c = { 1, 2 }; // std::initializer_list<int>
auto d { 1, 2 }; // ill-formed, too many elements
auto e { 1, 2.0}; // ill-formed, different type
12. 11
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STATIC_ASSERT WITH NO MESSAGE(N3928)
GCC: 6.0 Clang: 2.5 MSVS: 15.0
static_assert-declaration:
static_assert (constant-expression) ;
static_assert (constant-expression, string-literal) ;
static_assert(foo > bar);
...
static_assert(foo != bar);
13. 12
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
TYPENAME IN A TEMPLATE TEMPLATE PARAMETER(N4051)
GCC: 5.0 Clang: 3.5 MSVS: 14.0
template<typename T> struct A {};
template<typename T> using B = int;
template<template<typename> class X> struct C {};
C<A> ca; // ok
C<B> cb; // ok, not a class template
template<template<typename> typename X> struct D; // was error
14. 13
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
REMOVING TRIGRAPHS(N4086)
GCC: 5.1 Clang: 3.5 MSVS: 14.0
Removes ??=, ??(, ??>, etc
But we have digraph
??=include <iostream> /* # */
int main()
??< /* { */
char n??(??) = "Hello CoreHard_"; /* [ and ] */
n??(14??) = '0' + (??-0 ??' 1 ??! 2); /* ~, ^ and | */
std::cout << n << "??/n"; /* ??/ = */
return 0;
??>
15. 14
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
NESTED NAMESPACE DEFINITION(N4230)
GCC: 6.0 Clang: 3.6 MSVS: 14.3
Allows to write:
namespace A::B::C {
// some code
}
Rather than:
namespace A {
namespace B {
namespace C {
// some code
}
}
}
16. 15
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
NESTED NAMESPACE DEFINITION(N4230)
GCC: 6.0 Clang: 3.6 MSVS: 14.3
Allows to write:
namespace A::B::C {
// some code
}
Rather than:
namespace A {
namespace B {
namespace C {
// some code
}
}
}
namespace A::B::C::D {
namespace A::B::C::D {
namespace A::B::C::D {
namespace A::B::C::D {
// some code
}
}
}
}
17. 16
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
ATTRIBUTES FOR NAMESPACES AND ENUMERATORS(N4266)
GCC: 4.9(ns)/6.0(enum) Clang: 3.4 MSVS: 14.0(no enum)
enum E {
foo = 0,
foobar[[deprecated]] = foo
};
E e = foobar; // warning
namespace[[deprecated]] legacy{
void func() {}
}
legacy::func(); // warning, error in msvs14.3)
18. 17
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
U8 CHARACTER LITERALS(N4267)
GCC: 6.0 Clang: 3.6 MSVS: 14.0
UTF-8 character literal, e.g. u8'a'. Such literal has type char and
the value equal to ISO 10646 code point value of c-char, provided
that the code point value is representable with a single UTF-8
code unit. If c-char is not in Basic Latin or C0 Controls Unicode
block, the program is ill-formed.
The compiler will report errors if character cannot fit inside u8
ASCII range.
char c = u8'Ё'; // too many characters in constant
19. 18
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
ALLOW CONSTANT EVALUATION FOR ALL NON-TYPE TEMPLATE ARGUMENTS(N4268)
GCC: 6.0 Clang: 3.6 MSVS:no
template<int *p> struct A {};
int n;
A<&n> a; // ok
constexpr int *p() { return &n; }
A<p()> b; // error before C++17
20. 19
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
FOLD EXPRESSIONS(N4295)
GCC: 6.0 Clang: 3.6 MSVS: no
Reduces (folds) a parameter pack over a binary operator.
(pack op ...) // unary right fold
(... op pack) // unary left fold
(pack op ... op init) // binary right fold
(init op ... op pack) // binary left fold
Explanation:
1) Unary right fold (E op ...) becomes E1 op (... op (EN-1 op EN))
2) Unary left fold (... op E) becomes ((E1 op E2) op ...) op EN
3) Binary right fold (E op ... op I) becomes E1 op (... op (EN−1 op (EN op I)))
4) Binary left fold (I op ... op E) becomes (((I op E1) op E2) op ...) op EN
C++17 support 32 binary operators in fold expressions
21. 20
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
FOLD EXPRESSIONS(N4295)
GCC: 6.0 Clang: 3.6 MSVS: no
Allows to write compact code with variadic templates without using explicit
recursion. C++17 support 32 binary operators in fold expressions.
Before:
Now:
bool all() {
return true;
}
template<typename T, typename ...Args>
bool all(T t, Args ... args) {
return t && all(args...);
}
template<typename... Args>
bool all(Args... args) {
return (... && args);
}
22. 21
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
UNARY FOLD EXPRESSIONS AND EMPTY PARAMETER PACKS(P0036R0)
GCC: 6.0 Clang: 3.9 MSVS: no
When a unary fold is used with a pack expansion of length zero,
only the following operators are allowed:
1) Logical AND (&&). The value for the empty pack is true
2) Logical OR (||). The value for the empty pack is false
3) The comma operator (,). The value for the empty pack is void()
For any operator not listed above, an unary fold expression with
an empty parameter pack is ill-formed.
23. 22
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
REMOVING
Remove deprecated use of the register keyword(P0001R1)
GCC: 7.0 Clang: 3.8 MSVS: no
Remove deprecated operator++(bool)(P0002R1)
GCC: 7.0 Clang: 3.8 MSVS: no
Removing deprecated exception specifications from C++17(P0003R5)
GCC: 7.0 Clang: 4.0 MSVS: no
Removal of some deprecated types and functions, including
std::auto_ptr, std::random_shuffle, and old function adaptors(N4190)
24. 23
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
MAKE EXCEPTION SPECIFICATIONS PART OF THE TYPE SYSTEM(P0012R1)
GCC: 7.0 Clang: 4.0 MSVS: no
Until C++17 exception specifications for a function didn’t belong to
the type of the function, but it will be part of it.
void(*pf)();
void(**ppf)() noexcept = &pf; // error: cannot convert to pointer noexcept function
struct S { typedef void(*pf)(); operator pf(); };
void(*q)() noexcept = S(); // error: cannot convert to pointer noexcept function
25. 24
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
AGGREGATE INITIALIZATION OF CLASSES WITH BASE CLASSES(P0017R1)
GCC: 7.0 Clang: 3.9 MSVS: no
An aggregate is an array or a class with:
* no user-provided constructors (including those inherited from a base class),
* no private or protected non-static data members,
* no virtual functions, and
* no virtual, private or protected base classes
struct Base { int a1, a2; };
struct Derived : Base { int b1; };
Derived d1{ { 1, 2 }, 3 }; // full explicit initialization
Derived d2{ {}, 1 }; // the base is value initialized
26. 25
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
LAMBDA CAPTURE OF *THIS(P0018R3)
GCC: 7.0 Clang: 3.9 MSVS: no
Capturing this in a lambda's environment was previously
reference-only.
*this (C++17) will now make a copy of the current object, while
this (C++11) continues to capture by reference.
struct Foo {
int value{ 25 };
void test() {
auto getValueCopy = [*this] { return value; };
auto getValueRef = [this] { return value; };
value = 27
getValueCopy(); // 25
getValueRef(); // 27
}
};
27. 26
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
__HAS_INCLUDE IN PREPROCESSOR CONDITIONALS(P0061R1)
GCC: 5.0 Clang: 5.0 MSVS: no
This feature allows a C++ program to directly, reliably and
portably determine whether or not a library header is available
for inclusion.
#if __has_include(<string_view>)
#include <string_view>
#define has_string_view 1
#elif __has_include(<experimental/string_view>)
#include <experimental/string_view>
#define has_string_view 1
#define experimental_string_view 1
#else
#define has_string_view 0
#endif
28. 27
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
TEMPLATE ARGUMENT DEDUCTION FOR CLASS TEMPLATES(P0091R3)
GCC: 7.0 Clang: no MSVS: no
Before C++17, template deduction worked for functions but not
for classes.
std::make_pair("aaa"s, 111);
In C++17 template class constructors can deduce type
parameters.
std::pair("aaa"s, 111);
29. 28
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
TEMPLATE ARGUMENT DEDUCTION FOR CLASS TEMPLATES(P0091R3)
GCC: 7.0 Clang: no MSVS: no
Before C++17, template deduction worked for functions but not
for classes.
std::make_pair("aaa"s, 111);
In C++17 template class constructors can deduce type
parameters.
std::pair("aaa"s, 111);
std::tuple(
[](){}, [](){}, [](){}, [](){}, [](){}, [](){},
[](){}, [](){}, [](){}, [](){}, [](){}, [](){},
[](){}, [](){}, [](){}, [](){}, [](){}, [](){},
);
30. 29
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
NON-TYPE TEMPLATE PARAMETERS WITH AUTO TYPE(P0127R2)
GCC: 7.0 Clang: 4.0 MSVS: no
Automatically deduce type on non-type template parameters.
template <auto value> void f() { }
f<10>(); // deduces int
31. 30
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
CONSTEXPR LAMBDA EXPRESSIONS(P0170R1)
GCC: 7.0 Clang: no MSVS: no
Compile-time lambdas using constexpr.
auto identity = [](int n) constexpr { return n; };
static_assert(identity(123) == 123);
constexpr auto add = [](int x, int y) {
auto L = [=] { return x; };
auto R = [=] { return y; };
return [=] { return L() + R(); };
};
static_assert(add(1, 2)() == 3);
constexpr int addOne(int n) {
return [n] { return n + 1; }();
}
static_assert(addOne(1) == 2);
32. 31
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
ATTRIBUTES
GCC: 7.0 Clang: 3.9 MSVS: no
[[fallthrough]] attribute (P0188R1)
[[nodiscard]] attribute(P0189R1)
[[maybe_unused]] attribute
Ignore unknown attributes(P0283R2)
Using attribute namespaces without repetition(P0028R4)
33. 32
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
PACK EXPANSIONS IN USING-DECLARATIONS(P0195R2)
GCC: 7.0 Clang: 4.0 MSVS: no
Allows you to inject names with using-declarations from all types in a parameter pack.
template <typename T, typename... Ts>
struct Overloader : T, Overloader<Ts...> {
using T::operator();
using Overloader<Ts...>::operator();
// […] until
};
template <typename T> struct Overloader<T> : T {
using T::operator();
};
template <typename... Ts>
struct Overloader : Ts... {
using Ts::operator()...;
// […] С++17
};
34. 33
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
DECOMPOSITION DECLARATIONS(P0217R3)
GCC: 7.0 Clang: 4.0 MSVS: no
For example:
std::tie(a, b, c) = tuple; // a, b, c need to be declared first
std::array<T, 3> f();
std::tie(x, y, z) = f(); // INVALID.
Now we can write:
auto [a, b, c] = tuple;
auto [a, b, c] = f();
Such expressions also work on structs, pairs, and arrays.
35. 34
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
INIT-STATEMENTS FOR IF AND SWITCH(P0305R1)
GCC: 7.0 Clang: 3.9 MSVS: no
New versions of the if and switch statements for C++:
if (init; condition) and switch (init; condition).
Now you can write:
if (auto val = GetValue(); condition(val))
// on success
else
// on false...
36. 35
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
INLINE VARIABLES(P0386R2)
GCC: 7.0 Clang: 3.9 MSVS: no
A variable declared inline has the same semantics as a function declared inline: it can be
defined, identically, in multiple translation units, must be defined in every translation unit in
which it is used, and the behavior of the program is as if there is exactly one variable.
struct Foo
{
static const int sValue;
};
inline int const Foo::sValue = 777;
Or:
struct Foo
{
inline static const int sValue = 777;
};
37. 36
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STD::UNCAUGHT_EXCEPTIONS() (N4259)
GCC: 6.0 Clang: 3.7 MSVS: 14.0
The function returns the number of uncaught exception objects
in the current thread.
A type that wants to know whether its destructor is being run to
unwind this object can query uncaught_exceptions
in its constructor and store the result, then query
uncaught_exceptions again in its destructor; if the result is
different,
then this destructor is being invoked as part of stack unwinding
due to a new exception that was thrown later than the object’s
construction
38. 37
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
CONSTEXPR IF-STATEMENTS(P0292R2)
GCC: 7.0 Clang: 3.9 MSVS: no
if constexpr(cond)
statement1; // Discarded if cond is false
else
statement2; // Discarded if cond is true
39. 38
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STD::VARIANT
The class template std::variant represents a type-safe union. An
instance of std::variant at any given time holds a value of one of
its alternative types (it's also possible for it to be valueless).
std::variant<int, double> v{ 12 };
std::get<int>(v); // == 12
std::get<0>(v); // == 12
v = 12.0;
std::get<double>(v); // == 12.0
std::get<1>(v); // == 12.0
40. 39
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STD::OPTIONAL
The class template std::optional manages an optional contained value, i.e. a value that may or
may not be present. A common use case for optional is the return value of a function that may
fail.
std::optional<std::string> create(bool b) {
if (b)
return "Godzilla";
else
return {};
}
create(false).value_or("empty"); // == "empty"
create(true).value(); // == "Godzilla"
// optional-returning factory functions are usable as conditions of while and if
if (auto str = create(true)) {
// ...
}
41. 40
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STRING_VIEW
The class template basic_string_view describes an object that can refer to a
constant contiguous sequence of char-like objects with the first element of the
sequence at position zero.
A typical implementation holds only two members: a pointer to constant CharT
and a size.
// Regular strings.
std::string_view cppstr{ "foo" };
// Wide strings.
std::wstring_view wcstr_v{ L"baz" };
// Character arrays.
char array[3] = { 'b', 'a', 'r' };
std::string_view array_v(array, sizeof array);
std::string str{ " trim me" };
std::string_view v{ str };
v.remove_prefix(std::min(v.find_first_not_of(" "), v.size()));
str; // == " trim me"
v; // == "trim me"
42. 41
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STRING_VIEW
Problem
class foo
{
std::string str_;
public:
std::string_view get_str() const
{
// substr starting at index 1 till the end
return str_.substr(1u);
}
};
43. 42
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
STRING_VIEW
Solution
class foo
{
std::string str_;
public:
std::string_view get_str() const
{
// substr starting at index 1 till the end
return std::string_view(str_).substr(1u);
}
};
44. 43
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
FILE_SYSTEM
GCC: 6.0 Clang: 3.9 MSVS: 14.0
The Filesystem library provides facilities for performing operations on file systems and their
components, such as paths, regular files, and directories.
The filesystem library was originally developed as boost.filesystem
Structure:
path - represents a path
filesystem_error - an exception thrown on file system errors
directory_entry - a directory entry
directory_iterator - an iterator to the contents of the directory
recursive_directory_iterator - an iterator to the contents of a directory and its subdirectories
file_status - represents file type and permissions
space_info - information about free and available space on the filesystem
file_type - the type of a file
45. 44
C++ COREHARD SPRING 2017 //
IGOR SADCHENKO // C++ COREHARD // 13.05.17
ETC
std::any
std::byte
std:invoke
std::is_callable
std::apply
parallels algorithm
improved math
47. 46
C++ COREHARD SPRING 2017 // SUMMARY
IGOR SADCHENKO // C++ COREHARD // 13.05.17
CONCLUSION
• New standards are almost supported by compilers by the time of
release
• You can help make new C++ better
• C++ gets harder
• It is С++!
48. 47
C++ COREHARD SPRING 2017 // SUMMARY
IGOR SADCHENKO // C++ COREHARD // 13.05.17
LINKS
Last draft
http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/n4618.pdf
Current status of C++ standardization
https://isocpp.org/std/status
https://www.iso.org/standard/68564.html
WG21 C++ Russia
https://stdcpp.ru/
C++17 compiler support
http://en.cppreference.com/w/cpp/compiler_support
https://gcc.gnu.org/projects/cxx-status.html#cxx1z
http://clang.llvm.org/cxx_status.html#cxx17
https://blogs.msdn.microsoft.com/vcblog/2017/05/10/c17-features-in-vs-2017-3/
C++17 Features overview
http://www.bfilipek.com/2017/01/cpp17features.html
https://github.com/AnthonyCalandra/modern-cpp-features#stdstring_view