This is a talk I gave to my Research Group about C++11/C++14.
Since many of our students know little about C++, I decided to refresh their knowledge of C++ and to teach them about the C++11 modern features.
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
Introduction to binary translation in QEMU(TCG). Describe how it works. In addition, there is a section which demonstrate qemu-monitor, a debug tool for AArch64/QEMU.
There are lots of animations in the slides so download and open it with Microsoft PowerPoint for the best experience. Below is the download link.
Google Driver Link: http://goo.gl/XXMC9X
U-Boot, a boot loader for Embedded boards based on PowerPC, ARM, MIPS and several other processors, which can be installed in a boot ROM and used to initialize and test the hardware or to download and run application
code.
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
Introduction to binary translation in QEMU(TCG). Describe how it works. In addition, there is a section which demonstrate qemu-monitor, a debug tool for AArch64/QEMU.
There are lots of animations in the slides so download and open it with Microsoft PowerPoint for the best experience. Below is the download link.
Google Driver Link: http://goo.gl/XXMC9X
U-Boot, a boot loader for Embedded boards based on PowerPC, ARM, MIPS and several other processors, which can be installed in a boot ROM and used to initialize and test the hardware or to download and run application
code.
Adding support for you new shiny board in Xen on ARM is a simple task once you get a kernel running on bare metal.
This session will cover the different steps to port Xen on ARM from the firmware to the shell prompt in DOM0.
We will give you tips on the common pitfalls when you have your hypervisor, or your DOM0 kernel crashing. We will also provide suggestion on how to debug when the console is not working.
Presentation at Android Builders Summit 2012.
Based on the experience of working with ODM companies and SoC vendors, this session would discuss how to figure out the performance hotspot of certain Android devices and then improve in various areas including graphics and boot time. This session consists of the detailed components which seem to be independent from each other in traditional view. However, the situation changes a lot in Android system view since everything is coupled in a mass. Three frequently mentioned items in Android engineering are selected as the entry points: 2D/3D graphics, runtime, and boot time. Audience: Developers who work on Android system integration and platform enablement.
"OpenHPC is a collaborative, community effort that initiated from a desire to aggregate a number of common ingredients required to deploy and manage High Performance Computing (HPC) Linux clusters including provisioning tools, resource management, I/O clients, development tools, and a variety of scientific libraries. Packages provided by OpenHPC have been pre-built with HPC integration in mind with a goal to provide re-usable building blocks for the HPC community. Over time, the community also plans to identify and develop abstraction interfaces between key components to further enhance modularity and interchangeability. The community includes representation from a variety of sources including software vendors, equipment manufacturers, research institutions, supercomputing sites, and others."
Watch the video: http://wp.me/p3RLHQ-gKz
Learn more: http://openhpc.community/
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM SystemsThe Linux Foundation
The motivation of hypervisor based CPUFreq is to enable the one of the main PM use-cases (Dynamic voltage and frequency scaling) in virtualized system powered by Xen hypervisor. Rationale behind this activity is that CPU virtualization is done by hypervisor and the guest OS doesn't actually know anything about physical CPUs because it is running on virtual CPUs.
In this talk Oleksandr will briefly describe the possible approach of generic CPUFreq in Xen on ARM, the advantages and disadvantages of having DVFS support on ARM boards powered by Xen hypervisor and share results of his CPUFreq PoC which implies power consumption measurements with and without CPUFreq enabled on R-Car Gen3 based board as an example.
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
Speaker: Bill Fletcher
Date: September 24, 2015
★ Session Description ★
An introductory session of a system-level overview at Power State Coordination
- Focus on ARMv8
- Goes top-down from ACPI
- A demo based on the current code in qemu
- The specifications are very dynamic - what’s onging for ACPI and PSCI
★ Resources ★
Video: https://www.youtube.com/watch?v=vXzPdpaZVto
Presentation: http://www.slideshare.net/linaroorg/sfo15tr9-psci-acpi-and-uefi-to-boot
Etherpad: pad.linaro.org/p/sfo15-tr9
Pathable: https://sfo15.pathable.com/meetings/303087
★ Event Details ★
Linaro Connect San Francisco 2015 - #SFO15
September 21-25, 2015
Hyatt Regency Hotel
http://www.linaro.org
http://connect.linaro.org
WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for T...Jämes Ménétrey
The presentation slides of the paper WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for TrustZone, published in the proceedings of the 42nd IEEE International Conference on Distributed Computing Systems (ICDCS), July 2022.
Read the publication here: https://arxiv.org/abs/2206.08722
This publication incorporates results from the VEDLIoT project, which received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 957197
This slide provides a basic understanding of hypervisor support in ARM v8 and above processors. And these slides (intent to) give some guidelines to automotive engineers to compare and choose right solution!
Adding support for you new shiny board in Xen on ARM is a simple task once you get a kernel running on bare metal.
This session will cover the different steps to port Xen on ARM from the firmware to the shell prompt in DOM0.
We will give you tips on the common pitfalls when you have your hypervisor, or your DOM0 kernel crashing. We will also provide suggestion on how to debug when the console is not working.
Presentation at Android Builders Summit 2012.
Based on the experience of working with ODM companies and SoC vendors, this session would discuss how to figure out the performance hotspot of certain Android devices and then improve in various areas including graphics and boot time. This session consists of the detailed components which seem to be independent from each other in traditional view. However, the situation changes a lot in Android system view since everything is coupled in a mass. Three frequently mentioned items in Android engineering are selected as the entry points: 2D/3D graphics, runtime, and boot time. Audience: Developers who work on Android system integration and platform enablement.
"OpenHPC is a collaborative, community effort that initiated from a desire to aggregate a number of common ingredients required to deploy and manage High Performance Computing (HPC) Linux clusters including provisioning tools, resource management, I/O clients, development tools, and a variety of scientific libraries. Packages provided by OpenHPC have been pre-built with HPC integration in mind with a goal to provide re-usable building blocks for the HPC community. Over time, the community also plans to identify and develop abstraction interfaces between key components to further enhance modularity and interchangeability. The community includes representation from a variety of sources including software vendors, equipment manufacturers, research institutions, supercomputing sites, and others."
Watch the video: http://wp.me/p3RLHQ-gKz
Learn more: http://openhpc.community/
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
XPDDS18: CPUFreq in Xen on ARM - Oleksandr Tyshchenko, EPAM SystemsThe Linux Foundation
The motivation of hypervisor based CPUFreq is to enable the one of the main PM use-cases (Dynamic voltage and frequency scaling) in virtualized system powered by Xen hypervisor. Rationale behind this activity is that CPU virtualization is done by hypervisor and the guest OS doesn't actually know anything about physical CPUs because it is running on virtual CPUs.
In this talk Oleksandr will briefly describe the possible approach of generic CPUFreq in Xen on ARM, the advantages and disadvantages of having DVFS support on ARM boards powered by Xen hypervisor and share results of his CPUFreq PoC which implies power consumption measurements with and without CPUFreq enabled on R-Car Gen3 based board as an example.
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
Speaker: Bill Fletcher
Date: September 24, 2015
★ Session Description ★
An introductory session of a system-level overview at Power State Coordination
- Focus on ARMv8
- Goes top-down from ACPI
- A demo based on the current code in qemu
- The specifications are very dynamic - what’s onging for ACPI and PSCI
★ Resources ★
Video: https://www.youtube.com/watch?v=vXzPdpaZVto
Presentation: http://www.slideshare.net/linaroorg/sfo15tr9-psci-acpi-and-uefi-to-boot
Etherpad: pad.linaro.org/p/sfo15-tr9
Pathable: https://sfo15.pathable.com/meetings/303087
★ Event Details ★
Linaro Connect San Francisco 2015 - #SFO15
September 21-25, 2015
Hyatt Regency Hotel
http://www.linaro.org
http://connect.linaro.org
WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for T...Jämes Ménétrey
The presentation slides of the paper WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for TrustZone, published in the proceedings of the 42nd IEEE International Conference on Distributed Computing Systems (ICDCS), July 2022.
Read the publication here: https://arxiv.org/abs/2206.08722
This publication incorporates results from the VEDLIoT project, which received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 957197
This slide provides a basic understanding of hypervisor support in ARM v8 and above processors. And these slides (intent to) give some guidelines to automotive engineers to compare and choose right solution!
200 AÑOS EN EL PROCESO
Celebrando el Bicentenario del Estado de Luisiana 1812-2012
Referencia para Educadores K-12
Office of the Lieutenant Governor
Louisiana Bicentennial Commission
VERSIÓN EN ESPAÑOL
What every C++ programmer should know about modern compilers (w/o comments, A...Sławomir Zborowski
YT: https://www.youtube.com/watch?v=nfDTTxH5DsI
Many C++ programmers (especially beginners) either underestimate or don't actually know the power of modern C++ compilers. In the presentation I discuss architecture of modern compilers, how big they are and features (including recently emerged ones) that everyone should be aware of. I also cover tooling and ecosystem that has grown around compilers.
"Финансовый лизинг в МСФО и РСБУ. Методика расчета и отражение в учете"Елена Коптева
Презентация вебинара "Финансовый лизинг в МСФО и РСБУ. Методика расчета и отражение в учете", который провела компания "Кодерлайн". Ведущий - Иван КОЛЕСНИКОВ – консультант по МСФО, АССА .
http://www.koderline.ru
Презентация была представлена в ходе обсуждения вебинара "Scrum с нуля", автор - Валерий Федоров, руководитель проектов компании "Кодерлайн".
http://www.koderline.ru/
Обсуждение касалось вопроса, почему IT - самая передовая отрасль во всем мире отдает предпочтение именно Scrum. Выступающий представил личный практический опыт.
Introduction to C++
Difference between C and C++
Evolution of C++
Procedure Oriented Programming vs Object OrientedProgramming
Key concepts of Object-Oriented Programming
Advantages and Disadvantages of OOP
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...bhargavi804095
C++ is a cross-platform language that can be used to create high-performance applications.
C++ was developed by Bjarne Stroustrup, as an extension to the C language.
C++ gives programmers a high level of control over system resources and memory.
Thoughts and ideas on why and how to maintain a code repository with special attention to code style and documentation.
Includes some tips and recommendations about tools and standards you use or get inspiration from to keep your project in a good shape.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
Data privacy is one of the most critical issues that businesses face. This presentation shares insights on the principles and best practices for ensuring the resilience and security of your workload.
Drawing on a real-life project from the HR industry, the various challenges will be demonstrated: data protection, self-healing, business continuity, security, and transparency of data processing. This systematized approach allowed to create a secure AWS cloud infrastructure that not only met strict compliance rules but also exceeded the client's expectations.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
1. NAP Talks
C++14: Modern Programming for Demanding Times
Speaker: Carlos Miguel Ferreira
Position: PhD Student and IT Researcher
Contact: carlosmf.pt@gmail.com
2. Layout
1st Part – Some History
➔
Some background about C++
➔
Philosophy
➔
The International Standard
➔
Boost
➔
Standard Template Library
Break
Time
2 60/
2nd Part – The Basics
➔
Standard Types
➔
Methods
➔
Pointers and References
➔ Lambda Functions
➔ Casting in C++
➔
Structures and Classes
4th Part - Extreme C++
➔
Automatic Type Deduction
➔ Templates & Meta-Programming
➔ SFINAE rule
➔
Type Traits
3rd Part – Increased complexity
➔
Exceptions
➔
Smart Pointers
➔
Generic Containers
➔
Generic Algorithms
➔
Multi-threading
➔ Synchronization
3. 1st Part 3 60/
C++14
History, Philosophy and
Standards
Why waste time learning
when ignorance is instantaneous?
– Hobbes
4. C++ History 4 60/
The author: Bjarne Stroustrup
Development starts by the around 1978, during his PhD at
Churchill College, Cambridge.
Took inspiration from Simula
➔
Known as the first language to support Object Oriented
Programming.
➔ But it was to slow for practical use...
In the beginning, It was called “C with Classes”
First compiler: Cfront (derived from Cpre)
➔
Under the hood, just a translator
●
Translating classes to pure C.
●
Self-hosting compiler
●
Supported classes, basic inheritance, inlining, default arguments
●
It did not officially supported the OO paradigm...
5. C++ History 5 60/
In 1983:
➔
The language changes the name to C++
➔
First implementation in use
In 1986:
➔
First commercial release (Cfront PC port)
➔
But still no available standard…
In 1987:
➔
GNU C++ compiler v0.9 beta is released by Richard Stallman.
➔ New features were added:
●
Virtual functions, overloading, references…
●
It could then be called an Object Oriented Programming
Language!
●
“The C++ Programming Language 1st
Ed.” book is released.
Free Software
Foundation Founder
6. C++ Philosophy 6 60/
Some of the philosophical rules that guide the C++ language development.
Not All! Know more from the paper “Evolving a language in and for the real world: C++ 1991-2006”
DOI: 10.1145/1238844.1238848
General
➔
C++ evolution must be driven by real problems.
➔
Every feature must have a reasonably obvious
implementation.
➔
C++ is a language, not a complete system.
➔
Don’t try to force people to use a specific
programming style.
Technical
➔
Locality is good.
➔
Avoid order dependencies.
➔
Preprocessor usage should be eliminated.
Low-Level Support
➔
Leave no room for a lower-level language below
C++ (except assembler).
➔
What you don’t use, you don’t pay for (zero-
overhead rule).
Design
➔
Say what you mean.
➔
Provide facilities for program organization.
➔
All features must be affordable.
7. C++ International Standards (ISO) 7 60/
What are Technical Standards?
Even better, what are International Standards?
Technical Standards
A technical standard is an established norm or
requirement in regard to technical systems. It is
usually a formal document that establishes
uniform engineering or technical criteria,
methods, processes and practices. In contrast, a
custom, convention, company product, corporate
standard, etc. that becomes generally accepted
and dominant is often called a de facto standard.
International Standards
International standards are one way of
overcoming technical barriers in international
commerce caused by differences among
technical regulations and standards developed
independently and separately by each nation,
national standards organization, or company.
Technical barriers arise when different groups
come together, each with a large user base,
doing some well established thing that between
them is mutually incompatible. Establishing
international standards is one way of preventing
or overcoming this problem.
According to Wikipedia...
8. C++ International Standards (ISO) 8 60/
The C++ Standard intends to:
➔
Create an abstraction of a general computing machine.
➔
Defines a very rigid technical specification, asserting code portability.
●
It Defines Behaviours, and more important Undefined Behaviours!
➔
Defines the Standard Library (std::) behaviour. Very Important!
●
You will see lots of "the behaviour is defined/undefined" indications, in the C++ reference
manuals.
➔ It gave us the Standard Template Library (STL)
The C++ Standard is maintained by a Committee:
➔
Composed by companies, academics and freelancers representatives.
➔ Very strict review of new additions to the standard.
➔ Promote C++ learning and adoption.
➔
They usually take some time…
●
First Commercial was release in 1987...
●
But the 1st
ISO only came out in 1998! (C++98: ISO/IEC 14882:1998)
9. C++ International Standards (ISO) 9 60/
C++98
➔
The first one
➔
1998
➔
ISO/IEC 14882:1998
➔
Single Threading by design.
C++03
➔
2003
➔
ISO/IEC 14882:2003
Existing C++ Standards
C++11
➔
2011
➔
ISO/IEC 14882:2011
➔
Multi-threaded by design
C++14
➔
2014
➔
ISO/IEC 14882:2014
C++17
➔
Expected 2017
Old and quirky New and Improved!
vector<vector<int> >
vector_of_int_vectors;
The lack of a space between the “> >”
was an error in C++03. The compiler
got confused with the “>>” operator.
More information at: https://isocpp.org/std/status
10. C++ Boost→ 10 60/
“Boost provides free peer-reviewed portable C++
source libraries.
We emphasize libraries that work well with the C++
Standard Library. Boost libraries are intended to be
widely useful, and usable across a broad spectrum
of applications. The Boost license encourages both
commercial and non-commercial use.
We aim to establish "existing practice" and provide
reference implementations so that Boost libraries
are suitable for eventual standardization. Ten Boost
libraries are included in the C++ Standards
Committee's Library Technical Report (TR1) and in
the new C++11 Standard. C++11 also includes several
more Boost libraries in addition to those from TR1.
More Boost libraries are proposed for
standardization in C++17.”
The Boost Libraries
➔
First release in 1998
➔
After the Standard Library, Boost is
the most important library available
to the C++ development community.
➔
Many of its own libraries made their
way to the C++11 standard!
●
Arrays
●
Regular Expressions
●
Complex numbers
➔
More will be added to C++17.
●
Filesystem
More information at: https://www.boost.org
11. C++ Standard Template Library→ 11 60/
What is the Standard Template Library (STL)?
➔ A set of Generalized Structures
➔ A set of Algorithms for Generalized
Structures
●
The key here is generalized.
●
STL does not deal in specifics!
➔ Separates algorithms from storage in a way
that is classical (as in math) but not object
oriented.
➔
It separates policy decisions of algorithms,
such as sorting and search criteria, from the
container, and the element class.
➔
Standardized Structures and Behaviours!
Some of the available containers
<array>
<list>
<map>
<queue>
<set>
<stack>
<vector>
and many others...
More information at: http://en.cppreference.com/w/cpp/container
Later, I will talk more about
these containers
The result?
Unsurpassed flexibility and performance.
12. C++ 14 12 60/
This talk is about the C++14 Standard.
Threads
Containers
Lambda
Expressions
Automatic
Type deduction
Ranged for
Loops
Move
Constructors
Initialization
Lists
Type Traits
Smart
Pointers
13. 2nd Part 13 60/
C++14
Lets start with the basics!
A programmer is a machine
for turning caffeine into code.
– A programmer
14. Including 14 60/
C++ has many new features not present in C
To maintain compatibility and to keep C libraries usable in C++ environments, the
standard provides compatibility header files:
<cassert> (assert.h) → C Diagnostics Library
<cctype> (ctype.h) → Character handling functions
<cerrno> (errno.h) → C Errors
<csignal> (signal.h) → C library to handle signals
<cstdio> (stdio.h) → C library to perform Input/Output operations
<cstdlib> (stdlib.h) → C Standard General Utilities Library
<cstring> (string.h) → C Strings
<ctgmath> (tgmath.h) → Type-generic math
<ctime> (time.h) → C Time Library
<cuchar> (uchar.h) → Unicode characters
<cwchar> (wchar.h) → Wide characters
<cwctype> (wctype.h) → Wide character
The C precedes the name of the classical C header.
More information at: http://en.cppreference.com/w/cpp/header
15. The main function. 15 60/
Global method term used to catch
unhandled exceptions.
Uncaught exception handler is registered.
Program arguments are caught and
std::strings are created.
Don’t worry about the Exception
I will talk about them later...
std::exception is throwed.
16. Namespaces 16 60/
Same method declared in different
namespaces.
Result:
Namespaces are great for code management!
Explicitly choose the namespace
Or specifically state your intentions
The std:: namespace contains every C++
standardized type, function and object.
17. Standard Types → void, bool and char 17 60/
The C++ 14 standard specifies the behaviour for a set of types.
➔
Most are from C99 standard.
➔
Fundamental types are not inside the namespace std::
Void type
➔ void
➔ nullptr literal
➔ std::nullptr_t type
Boolean Type
➔ bool → true or false
Character types
➔ char (signed/unsigned)
➔ wchar_t
➔ char16_t
➔ char32_t
Special types!
Standard dictactes there cannot be void type arrays.
void size is undefined!
The most efficiently processed character representation on the
target system (size undefined).
The necessary size to represent any kind of supported character
code unit (32bits for Unicode systems).
Large enough for:
●
UTF-16
●
UTF-32
Size is 1 byte
18. Standard Types i→ nteger, float and double 18 60/
Floating point types (IEEE-754)Integer types
➔ float → single precision
➔ double → double precision
➔ long double → extended precision
int (signed/unsigned)→ 2 bytes at least
➔ short –----→ 2 bytes at least
➔ long –----→ 4 bytes at least
➔ long long –----→ 8 bytes at least
More information at: http://en.cppreference.com/w/cpp/language/types
Defined by Standard
➔
Sizes are undefined.
➔
Instead, the standard defines the precision
behaviour, and special values.
●
Infinity
●
Negative Zero
●
Not-a-Number (NaN)
➔
Arithmetic operations are also specified
19. Standard Types Fixed Width Integers→ 19 60/
Fixed Width Integer types
(all within std::)
int8_t
int16_t
int32_t
int64_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
intptr_t
More information at: http://en.cppreference.com/w/cpp/types/integer
uint8_t
uint16_t
uint32_t
uint64_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
uintptr_t
➢
Integer type with width of
exactly 8, 16, 32 and 64 bits
Signed Unsigned
➢
Fastest integer type with
width of at least 8, 16, 32 and
64 bits
➢
Smallest integer type with
width of at least 8, 16, 32 and
64 bits
➢
Maximum width integer type
➢ Integer type capable of holding
a pointer
20. Standard Types Enumerators→ 20 60/
Specifying the enum memory size
➔
This is a hidden inheritance
Enumerations declarations
➔
By default, the size is int
Get the defined enumerations
using the :: scope resolution
operator
21. Standard Types Strings→ 21 60/
Available at <string>
Regular expressions at <regex>
➔ String → char
➔ wstring → wchar_t
➔ u16string → char16_t
➔ u32string → char32_t
More information at: http://en.cppreference.com/w/cpp/header/string
These
types
use these
fundamental
types
underneath
Initializations
Attributions
Concatenations
Iterations
Compatibility
22. Methods 22 60/
Result
Method Overloading
The names are equal
➔
Different signatures for equivalent behaviours
➔
Keep code clean, elegant!
➔
No method naming Hell!
23. Pointers, References and the const specifier 23 60/
Pointers and References
(prefer references, unless working with C)
Pointers are useful but:
➔
Is there really an object at address 0x123?
➔
Good code always checks if memory is accessible.
➔
Memory checks cost processing time...
➔ A pointer value could be NULL
References provide assurance:
➔
Object must exists! (sort of)
The const type qualifier provides robustness:
➔
Forbids state modification
Yes, you can always hack it, but seriously… don’t…
➔
Always avoid this
●
Unless you’re using a buggy library…
➔
Never ever in your life do this!!!
●
You have been warned!
●
The segfault Hell awaits you, if you ignore...
24. Lambda functions 24 60/
Also called anonymous functions
Lambda functions are useful to:
➔
Keep code localized and contained
➔
Pass callbacks to functions, event managers or threads!
Lambda signature
➔ [ capture-list ] ( params ) mutable → ret { body }
Capture List
➔
[a,&b] → a captured by value and b is captured by reference.
➔
[&] → captures all automatic variables odr-used in the body of the lambda by reference
➔
[=] → captures all automatic variables odr-used in the body of the lambda by value
➔
[] → captures nothing
Mutable specifier (optional)
➔
Allows body to modify the parameters captured by copy, and to call their non-const member
functions. It means it can mutate (change its own state).
More information at: http://en.cppreference.com/w/cpp/language/lambda
One Definition Rule
25. Lambda functions 25 60/
More information at: http://en.cppreference.com/w/cpp/language/lambda
A lambda is created and saved in f1 and f2
Lambda Functions in action
(using std::function type in this example)
But f1 does not modify the x value despite being mutable.
f2 is not mutable but modifies x. Why?
f1 is mutable. x is passed by copy.
f2 is not mutable and is not allowed to change its state.
To f2, x is passed by reference.
f1 copies x and then changes it, within its own context.
f2 changes x because x is passed by reference.
f2 is not mutating its own state.
26. Structures and Classes 26 60/
More information at: http://en.cppreference.com/w/cpp/language/class
C++ provides two ways of structuring complex objects
Structures Classes
➔
By default, attributes and methods are
public (friendship)
➔ Can be used with C code
➔
By default, attributes and methods are
private (friendship)
➔ Cannot be used with C Code
In truth, these are the only differences between Structs and
Classes in C++.
Both Types support:
➔
Constructors
➔
Polymorphism through inheritance
➔
Friendship
➔
Operator Overloading
➔
Casts Operators
➔
They can even be mixed (classes
inheriting from structs and vice
versa)
➔
But classes are the standard for
oriented programming.
27. Structs and Classes Vocabulary→ 27 60/
More information at: http://en.cppreference.com/w/cpp/language/class
Vocabulary is important when talking about
Object Oriented Programming
Structs
Classes
Memory
Allocation Object
Object Instantiation
Object
Blueprints
28. Structs and Classes Breaking with the old→ 28 60/
Code organization is VERY important when talking
about Object Oriented Programming
Past Ghosts from C code organization
You were led to believe that:
➔
For each .hpp header, there should be a .cpp module.
➔
Header should only have prototypes, modules should have the real code.
Nothing could be further from the truth…
It is possible to develop C++ code using only headers, while having
only 1 module.
➔
Location where main is implemented.
➔
Location where static objects and class attributes are declared.
➔
Code in header files can be inlined!
29. Classes Attributes and Access Management→ 29 60/
By default, Class attributes are private
Enumeration can be defined within classes
static attribute. These are shared between all Top instantiations.
Private method. Can only be called from Top context or Top
friends (friendship explained later).
Private default constructor. There can be no Top X()
Protected attributes. A class that inherits from Top, can access
these attributes/methods.
private
public
private
protected
public
Public attributes. These can be accessed by everyone and
everything.
Be careful with these, if not const. State can be modified without
the object knowing about such.
Rule of Thumb! Object attributes should always be private, with the
exception of const attributes.
30. Classes Constructors and Destructor→ 30 60/
Result
Private unique pointer to string with
pointer default initialization
Copy Constructor
Move Constructor
Destructor
Default Constructor
Explicit String Copy Constructor
Acessing unique pointer
after move
Undefined Behaviour!
More information at: http://en.cppreference.com/w/cpp/language/classes
31. Classes Implicit Copy Constructor→ 31 60/
Implicit construction
Implicit constructors can be a source of
confusion.
B as a copy constructor for A
C as a copy constructor for B
C can be built using an object A using B
copy constructor as an intermediate.
C++ only travels 1 hop!
➔
C calls B calls A → Allowed!
➔
D calls C calls B calls A → Not Allowed!
Avoid the implicit construct by
marking a copy/type constructor
as explicit
32. Classes → const Methods and Attributes 32 60/
Result
const attribute. Once initialized, it cannot be
modified (immutable).
A const attribute can only be returned using a const
modifier with the returned value.
const modifier should be used when returning the
reference of an internal attribute.
const modifier for the method means, the method does
not modify the objet internal state
Never ever do this. It
exposes to modification, the
private attribute.
Moving a string.
string_moved
was cleared.
33. Classes Operator Overloading→ 33 60/
Result
Array subscript operator to access a specific
character from attr.
Sum operator to concatenate the attr from
two different Top objects.
Assignment operator to assign a new value to
attr coming from another Top object.
Stream insertion operator
➔ friend operator
➔ NOT a Top class operator!
➔
It is an Out-of-Member Operator
➔
No this reference access
34. Classes Casting Operators→ 34 60/
Cast Operators
➔
It allows an object to transformed
to other types of objects.
➔
By default, casts are implicit!
➔
Like the constructors, casts can be
declared explicit.
Result
Explicit cast
Implicit cast
35. Classes Inheritance & Polymorphism→ 35 60/
Polymorphism a fundamental concept in C++
It is divided into two different types
Run-time Polymorphism
➔ Implements a virtual table
(v-table) to provide
polymorphism.
➔
Overhead due to v-table.
➔
Requires Run Time Type
Information (RTTI)
Compile-Time Polymorphism
➔ Methods are not overridden
➔
No v-table
➔
No overhead
➔
No dynamic casting
➔
Good for code reuse
Disclaimer
I will not talk about Multiple-Inheritance
It is a complex world...
36. Classes Polymorphic Inheritance→ 36 60/
Abstract Class
➔
Classes with a pure virtual
method (= 0)
Pure Virtual
Methods must be
implemented by
lower classes.
Circle and Square
inherit from Figure
➔
In order for a method to be overridden, it needs to be declared as virtual.
➔
A polymorphic object is an object with at least one virtual method.
Polymorphic
objects must have
a virtual destructor
37. Classes Polymorphic Inheritance→ 37 60/
Result
Polymorphism allows a programmer to deal
with the abstract.
➔
A Figure list (Figure is the abstraction)
➔
Circle and Square are Figure implementations
The Virtual Table
➔
Calls are made to Circle and Square
implementations, respectively
➔
The virtual table pointer is located in memory,
along with the Information Type about the
Polymorphic class (extra 8 bytes in x86_64).
40. Classes Friendship→ 40 60/
Friendship
➔
It allows an object to grant
access to specific entities
➔ Entities can be:
➢
Objects
➢
Methods
➔
Friend declaration can be
used for prototype.
➔
Beware! Objects internal
state can be exposed if
misused.
41. Casting in C++ 41 60/
C++ provides 4 types of Casting
Static Casting Dynamic Casting
Reinterpret Casting Const Casting
➔
Explicit casting
➔
Non-Polymorphic Casting
➔
Type checks are performed during compile-time
➔
Checks if conversion is possible
➔
Less restrictive than Dynamic Casting
➔
Used for Polymorphic Casting
➔
Performed during run-time
➔
The safest type of casting (and most expensive)
➔
The NUCLEAR CAST
➔
Direct conversion, just like C Casts
➔
Performs absolutely no type checks
➔
Can generate SegFaults if misused..
➔
Used to add or remove const attribute.
➔
Used when it is absolutely necessary to remove
consteness (anti-patern)
●
Buggy libraries where it is necessary to
break through const to solve issues.
●
Modifying const values results in undefined
behaviour.
More information at: http://en.cppreference.com/w/cpp/language/expressions#Conversions
43. 3rd Part 43 60/
C++14
Increasing the complexity...
For every complex problem,
there is an answer that is
clear, simple, and wrong.
– H. L. Mencken
44. Exceptions 44 60/
Exceptions is how C++ deals with errors
Using exceptions allows to:
➔
Errors handling organization.
➔
Delegate error treatment to upper
calls, via stack unrolling.
All exceptions specification should
inherit from std::exception and
override the
const char * what() method.
45. Smart Pointers – Auto Memory Management 45 60/
Available at <memory>
More information at: http://en.cppreference.com/w/cpp/memory
Three types of Smart Pointers exist
Before C++11, there was only two choices:
➔
Manual Memory Management
●
Prone to errors and object leaks
●
Segfault Hell world...
➔
Resort to Boost Libraries
●
Despite high quality, not standard...
Unique Pointers
➔
Single Ownership
Shared Pointers
➔
Shared Ownership
Weak Pointers
➔
No Ownership
unique_ptr shared_ptr
weak_ptr
Smart pointers are responsible for the memory
management of the object to which they point!
After C++11, there are Smart Pointers!
➔
Automatic Memory Management
➔
Developer is free from memory management
●
Less bugs from object leaks
●
Objects existence is self managed
●
Increased Code robustness
46. Smart Pointers Unique Pointers→ 46 60/
More information at: http://en.cppreference.com/w/cpp/memory/unique_ptr
Unique pointers cannot be copied!
1 to 1 relationship with object
Result
Pointer is created with object constructor
arguments
Context is closed, pointer and object are
destroyed
Pointer is created, with object.
Pointer is transferred to Method
Method execution ends, pointer and object
are destroyed.
Unique pointers cost ZERO in
performance!
47. Smart Pointers Shared Pointers→ 47 60/
More information at: http://en.cppreference.com/w/cpp/memory/shared_ptr
Result
Pointer 1 is created without object
Pointer 2 is created with object
Pointer 2 is copied to pointer 1, reference
counter is increased in 1.
Context is closed, pointer 2 is destroyed
Context is closed, pointer 1 and object are
destroyed.
Shared pointers can be copied!
Many to 1 relationship with object
➔
Shared pointers track object ownership,
using a per-object, shared, internal
reference counter.
➔
When the counter reaches zero, the
object is destroyed.
Beware!
Shared pointers are vulnerable to
circular reference issues
48. Smart Pointers Weak Pointers→ 48 60/
More information at: http://en.cppreference.com/w/cpp/memory/weak_ptr
Weak pointer is created
Shared pointer 1 is created with object
Shared pointer 1 info related to object is
copied into weak pointer.
Verification if object still exists (true)
Shared pointer 2 is created from Weak
pointer.
Context is closed, pointer 2 is destroyed
Context is closed, pointer 1 and object are
destroyed
Verification if object no longer exists (true)
Weak pointers have no object ownership!
Used to avoid circular reference issues.
➔
To access an object pointed by weak
pointers, it is required to create a Shared
Pointer.
➔
Shared pointer creation may fail, if object
no longer exists!
Result
49. C++ Generic Containers→ 49 60/
The power of the Standard Template
Library, is easily seen in its Generic Data
containers.
Generic Containers (some of them)
➔
Arrays <array>
➔ Vectors <vector>
➔ Lists <list>
➔
Maps <map>
➔
Sets <set>
➔
Stacks <stack>
➔
Queues <queue>
More information at: http://en.cppreference.com/w/cpp/container
50. C++ Generic Algorithms→ 50 60/
Generic Algorithms for Generic
Structures.
➔ Searching
●
Binary Search
➔ Sorting
➔
Swapping
➔
Copying
➔
Partitioning
➔
Set Operations
➔
Minimum/Maximum Operations
➔
Numeric Operations
More information at: http://en.cppreference.com/w/cpp/algorithm
Result
Available at <algorithm>
51. C++ Threads and Locks→ 51 60/
More information at: http://en.cppreference.com/w/cpp/thread/thread
http://en.cppreference.com/w/cpp/thread/mutex
➔ Type declaration for the thread “main”
➔ Number of available hardware threads
➔
Shared counter
➔
List of Threads
➔ Threads will increase the counter, until it
reaches 1000000
➔ Thread object creation
➔
Moving thread to the list, NOT COPY!
➔ Master thread will wait for working
threads to end
➔
Final counter value is printed
Available at <thread>
52. C++ Threads and Locks→ 52 60/
Result
Result
More information at: http://en.cppreference.com/w/cpp/thread/thread
http://en.cppreference.com/w/cpp/thread/mutex
But… there is a synchronization problem!
For 90% of the trials, the result is
correct!
But the problem is the remaining
10%...
53. C++ Threads and Locks→ 53 60/
We solve the problem with a mutex!
Before accessing the shared
resource, the thread locks the access
When it no longer needs the
resource, it releases the lock!
Result
Available at <mutex>
54. 4th Part 54 60/
C++14
Extreme Properties
It ain’t what you don’t know that gets you into trouble.
It’s what you know for sure that just ain’t so.
– Mark Twain
WARNING
If you don’t understand at first, don’t worry… neither did I
This is mostly to show C++14 capabilities
55. C++ Templates & SFINAE→ 55 60/
C++ provides a Meta-programming language
➔
It is very helpful for automatic code generation!
This language is implemented using templates
➔ The base of STL
➔ Allow the creation of Generic Code
➔
Developers focus on algorithms and establish boundaries
for type deduction
Substitution Failure Is Not An Error (SFINAE)
➔
This rule applies during overloading resolution of
function templates.
➔
Specializations are discarded, when the compiler fails to
substitute the types in the template parameters.
More information at: http://en.cppreference.com/w/cpp/language/templates
http://en.cppreference.com/w/cpp/language/partial_specialization
http://en.cppreference.com/w/cpp/language/sfinae
Template Processing
1st
➔
Recursive template code
evaluation
➔
Template Parameter Substitution
●
SFINAE validation
2nd
➔ Code Inlining and Compilation
56. C++ Automatic Type Deduction→ 56 60/
Result
➔ Just a “magic method” that outputs the name of the
object type
Template with automatic type deduction, with type identification from operation.
SFINAE rule discards incorrect template
Automatic type deduction from provided
value
Automatic type deduction from make_shared operation
More information at: http://en.cppreference.com/w/cpp/language/auto
57. C++ Templates with Type Traits→ 57 60/
Result
More information at: http://en.cppreference.com/w/cpp/header/type_traits
Templates with
Type Traits
Recursive
Templates
Available at <type_traits>
58. C++14 Efficient Modern Development→ 58 60/
Summarizing important C++ modern features
➔
Cleaner and Sane Syntax
➔
Lambda Functions
● Powerful way to organize code and reduce namespace pollution.
➔
Move Constructor and Move Semantics
●
Allows zero-copy transfer of attribute information
➔
Smart Pointers
●
Automatic Memory Management with Ownership Management
➔
Improved Generic Containers
●
Updated with Move semantics
➔
Improved Generic Algorithms
●
Lots of generic algorithms
●
C++17 will bring Parallel Algorithms
➔
Automatic Type Deduction
➔
Templates Type Traits
●
Type boundary capabilities
59. C++14 Resources→ 59 60/
Websites
➔
http://www.cppreference.com
➔
http://www.cplusplus.com/
Recommended Books
➔
The C++ Programming Language 4th Edition (Addison.Wesley Jun 2013)
➔
Programming Principles and Practice Using C++, 2nd Edition (Addison Wesley, 2014)
➔ Professional C++ 3rd Edition (2014)
➔ Effective Modern C++ (OReilly2014)
➔ C++ For Dummies, 7th Edition (2014)
➔
A Tour of C++ (2013 Addison Wesley)
Libraries and Frameworks worth of checking out
➔
Boost
➔
POCO
➔
QT5
60. C++14 We are done!→ 60 60/
Thank you for your patience!