C++11 and Compiler Update

Similar documents
RAD Studio XE3 The Developer Force Multiplier

C++11/14 Rocks. Clang Edition. Alex Korban

C++11: 10 Features You Should be Using. Gordon R&D Runtime Engineer Codeplay Software Ltd.

September 10,

C The new standard

C++11/14 Rocks. VS2013 Edition. Alex Korban

Introduction to C++11 and its use inside Qt

C++11 Introduction to the New Standard. Alejandro Cabrera February 1, 2012 Florida State University Department of Computer Science

Advanced Programming & C++ Language

C++ Primer, Fifth Edition

C# and Java. C# and Java are both modern object-oriented languages

C++ (Non for C Programmer) (BT307) 40 Hours

Arrays. Returning arrays Pointers Dynamic arrays Smart pointers Vectors

C++ Programming Lecture 7 Software Engineering Group

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

Object-Oriented Programming

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Introduction to C++ with content from

Overload Resolution. Ansel Sermersheim & Barbara Geller Amsterdam C++ Group March 2019

Remedial C Now that we can actually use it Pete Williamson

Pointers. Developed By Ms. K.M.Sanghavi

Tokens, Expressions and Control Structures

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

Overload Resolution. Ansel Sermersheim & Barbara Geller ACCU / C++ June 2018

CS

Programming Language C++11. Summary of changes and general feature description. Niedl, Markus

Modern C++, From the Beginning to the Middle. Ansel Sermersheim & Barbara Geller ACCU / C++ November 2017

Advanced C++ Programming Workshop (With C++11, C++14, C++17) & Design Patterns

Advanced Systems Programming

Advanced C++ Topics. Alexander Warg, 2017

Absolute C++ Walter Savitch

Final-Term Papers Solved MCQS with Reference

Introduction to Programming Using Java (98-388)

Expansion statements. Version history. Introduction. Basic usage

Bigger Better More. The new C++ Standard Library. Thomas Witt April Copyright 2009 Thomas Witt

CS 251 INTERMEDIATE SOFTWARE DESIGN SPRING C ++ Basics Review part 2 Auto pointer, templates, STL algorithms

C++14 (Preview) Alisdair Meredith, Library Working Group Chair. Thursday, July 25, 13

Modernizing legacy C++ code

1/29/2011 AUTO POINTER (AUTO_PTR) INTERMEDIATE SOFTWARE DESIGN SPRING delete ptr might not happen memory leak!

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Structured bindings with polymorphic lambas

Smart Pointers. Some slides from Internet

Database Systems on Modern CPU Architectures

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured

Introduce C# as Object Oriented programming language. Explain, tokens,

CHAPTER 1: A CRASH COURSE IN C++ 3 CHAPTER 2: DESIGNING PROFESSIONAL C++ PROGRAMS 49

Object Oriented Programming. Solved MCQs - Part 2

Outline. 1 About the course

CPSC 427: Object-Oriented Programming

Microsoft Visual C# Step by Step. John Sharp

Generalized Constant Expressions

C++ Programming Lecture 7 Software Engineering Group

use static size for this buffer

MODERNIZATION C++ Bjarne Stroustrup, creator of C++

CSCI-1200 Data Structures Fall 2011 Lecture 24 Garbage Collection & Smart Pointers

Making New Pseudo-Languages with C++

I m sure you have been annoyed at least once by having to type out types like this:

VALLIAMMAI ENGINEERING COLLEGE

C++ Important Questions with Answers

std::optional from Scratch

An introduction to C++ template programming

Fast Track to Core Java 8 Programming for OO Developers (TT2101-J8) Day(s): 3. Course Code: GK1965. Overview

G52CPP C++ Programming Lecture 20

Instantiation of Template class

A Crash Course in (Some of) Modern C++

Type Inference auto for Note: Note:

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP

Implicit Evaluation of auto Variables and Arguments

IBM i Version 7.3. Programming IBM Rational Development Studio for i ILE C/C++ Language Reference IBM SC

Fast Introduction to Object Oriented Programming and C++


Outline. 1 Function calls and parameter passing. 2 Pointers, arrays, and references. 5 Declarations, scope, and lifetimes 6 I/O

Introduction to C++ Systems Programming

Object-Oriented Principles and Practice / C++

Inheritance, Polymorphism and the Object Memory Model

A polymorphic value-type for C++

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors

POLYMORPHISM 2 PART. Shared Interface. Discussions. Abstract Base Classes. Abstract Base Classes and Pure Virtual Methods EXAMPLE

An Introduction to Template Metaprogramming

Intermediate C++ 1/83

Announcements. CSCI 334: Principles of Programming Languages. Lecture 18: C/C++ Announcements. Announcements. Instructor: Dan Barowy

Java 8 Programming for OO Experienced Developers

Improve your C++! John Richardson. Lab Study Meeting 2013

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Object Oriented Paradigm

Microsoft. Microsoft Visual C# Step by Step. John Sharp

CPSC 427: Object-Oriented Programming

CSCI-1200 Data Structures Spring 2017 Lecture 27 Garbage Collection & Smart Pointers

CPSC 427: Object-Oriented Programming

Index. Symbols. bit sequence, 27 ^ (exclusive OR) operator, 30 hexadecimal number, 27 left shift (<<) operator, 31 right shift (>>) operator, 32

G Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University

Dr. Md. Humayun Kabir CSE Department, BUET

Java Fundamentals (II)

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

A polymorphic value-type for C++

Axivion Bauhaus Suite Technical Factsheet AUTOSAR

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things.

Short Notes of CS201

Rust for C++ Programmers

Transcription:

C++11 and Compiler Update John JT Thomas Sr. Director Application Developer Products

About this Session A Brief History Features of C++11 you should be using now Questions 2

Bjarne Stroustrup C with Objects (1979) Modeled OO after Simula and Ada But syntax and RTL based on C Classes Inheritance Inlining Default arguments Type checking CFront compiler

A Brief History of C++ EMBARCADERO TECHNOLOGIES

C++11 A new Standard Language Rvalue references and move constructors constexpr - Generalized constant expressions Core language usability enhancements Initializer lists Uniform initialization Type inference Range-based for-loop Lambda functions and expressions Alternative function syntax Object construction improvement Explicit overrides and final Null pointer constant Strongly typed enumerations Right angle bracket Explicit conversion operators Alias templates Unrestricted unions Library Variadic templates New string literals User-defined literals Multithreading memory model Thread-local storage Explicitly defaulted and deleted special member functions Type long long int Static assertions Allow sizeof to work on members of classes without an explicit object Control and query object alignment Allow garbage collected implementations Threading facilities Tuple types Hash tables Regular expressions General-purpose smart pointers Extensible random number facility Wrapper reference Polymorphic wrappers for function objects Type traits for metaprogramming

auto keyword Type inference auto asks the compiler to deduce the type Helps with readability of code especially with template container iterators auto i = 9; //int auto f = 3.14f; //float auto f = new foo(); //foo* 9

ranged for loop a for_each concept to loop through standard containers Any type with a begin() and end() for (auto i : map) access I by value Use auto& I for ref to modify Use auto const & I for ref to ready only 10

Smart pointers C++ version of ARC auto_ptr is deprecated 3 new smart pointers in C++11 unique_ptr, shared_ptr, and weak_ptr unique_ptr Ownership of memory does not have to be shared Can be transferred to another unique_ptr with a move constructor shared_ptr Ownership of memory is shared (reference counted) weak_ptr Reference to an object managed by shared_ptr but does not contribute to the ref count Used to avoid reference cycle 11

Move semantics Modify rvalue references Specified by && Implemented as a move constructor and move assignment operator 12

Uniform initialization syntax C++ have a long history with sporadic compatibility with C Thus, there are several ways to initiate a variable STL containers required dynamic initilization 13 i.e. push_back

Override and final Deaks with typical inheritance issues/mistakes Differing signatures accidently resulting in a non override Override indicates a method is supposed to overried a virtual method in its base final indicates a method can no longer be overridden 14

nullptr Zero (integer) used to be value of null pointers Could result in implicit type conversion nullptr is of type std::nullptr_t that represents a null pointer literal Implicit conversion from nullptr to null pointer value of any pointer type 15

lambda expressions New syntax for defining anonymous functions Can be used to define closures to capture variables [capture-list] (params) {body;} [capture-list] (params) ->ret {body;} [capture-list] (params) mutable exception attributed -> ret {body;} 16

C++ Compiler Update 17

Active projects Move to CLANG 3.3 Full C++ compliance futures/async Support C++11 on all platforms Win32 CLANG based toolchain Current version owners will be invited to participate in a beta when it is released 18

Questions? 19