C++98 Initial Standard ~7 years C++03 Revised standard Limited to bug fixing ~ 5 years TR1 Pure library extension ~3 years C++11 Significant new features.

Slides:



Advertisements
Similar presentations
Brown Bag #3 Return of the C++. Topics  Common C++ “Gotchas”  Polymorphism  Best Practices  Useful Titbits.
Advertisements

What's new in Microsoft Visual C Preview
Visual Studio 2013 Conformance Performance Productivity Services Mobile Devices What’s Next.
CSE 332: C++ copy control II Copy Control (Part II) Review: copy control consists of 5 distinct operations –A copy constructor initializes an object by.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Lecture 9 Concepts of Programming Languages
Introduction to Classes and Objects CS-2303, C-Term Introduction to Classes and Objects CS-2303 System Programming Concepts (Slides include materials.
Java Data Types  Everything is an Object  Except Primitive Data Types  For efficiency  Platform independent  Portable  “slow”  Objects are often.
1 Classes and Objects. 2 Outlines Class Definitions and Objects Member Functions Data Members –Get and Set functions –Constructors.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
OOP Languages: Java vs C++
JavaServer Pages Syntax Harry Richard Erwin, PhD CSE301/CIT304.
Programming Languages and Paradigms Object-Oriented Programming.
CSIS 123A Lecture 12 Templates. Introduction  C++ templates  Allow very ‘general’ definitions for functions and classes  Type names are ‘parameters’
LECTURE LECTURE 17 More on Templates 20 An abstract recipe for producing concrete code.
CIS 068 JAVA vs. C++ Main Differences. CIS 068 JAVA vs C++ Java is (an interpreted) write once, run anywhere language. –The biggest potential stumbling.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
CSE 425: Data Types II Survey of Common Types I Records –E.g., structs in C++ –If elements are named, a record is projected into its fields (e.g., via.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 3: Objects, Types, and Values 1 Based on slides.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Introduction to Java University of Sunderland CSE301 Harry R. Erwin, PhD.
Programming Language C++ Xulong Peng CSC415 Programming Languages.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
1 C++ Syntax and Semantics, and the Program Development Process.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
C# EMILEE KING. HISTORY OF C# In the late 1990’s Microsoft recognized the need to be able to develop applications that can run on multiple operating system.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
Managing C++ CHRIS DAHLBERG MID-TIER DEVELOPER SCOTTRADE.
Unrestricted © Siemens AG 2015 All rights reserved.Smarter decisions, better products. Move semantics && rvalue references, part 2 Bert Rodiers, Software.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
1 Becoming More Effective with C++ … Day Two Stanley B. Lippman
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
Chapter 3 Templates. Objective In Chapter 3, we will discuss: The concept of a template Function templates Class templates vector and matrix classes Fancy.
CSE 332: C++ pointers, arrays, and references Overview of Pointers and References Often need to refer to another object –Without making a copy of the object.
Basic Types, Variables, Literals, Constants. What is in a Word? A byte is the basic addressable unit of memory in RAM Typically it is 8 bits (octet)
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Assignment 4 is due Nov. 20 (this Friday). Today: –Templates. –STL –Smart Pointers.
Reference Types CSE301 University of Sunderland Harry R Erwin, PhD.
CSCE Introduction to Program Design and Concepts J. Michael Moore Spring 2015 Set 6: Miscellaneous 1 Based on slides created by Bjarne Stroustrup.
FASTFAST All rights reserved © MEP Make programming fun again.
Value Types. 2 Objectives Discuss concept of value types –efficiency –memory management –value semantics –boxing –unboxing –simple types Introduce struct.
Programming in Go(lang)
CO4301 – Advanced Games Development Week 1 Introduction
CIS 068 JAVA vs. C++ Main Differences CIS 068.
C++ Lesson 1.
Jim Fawcett CSE775 – Distributed Objects Spring 2009
Objectives In this chapter, you will:
Enumeration Type Data type: a set of values with a set of operations on them Enumeration type: a simple data type created by the programmer To define an.
C++ INTERVIEW QUESTIONS
Jim Fawcett CSE687-OnLine – Object Oriented Design Summer 2017
C Basics.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Lecture 9 Concepts of Programming Languages
Built-In (a.k.a. Native) Types in C++
Using C++ in your Windows Phone Applications Talk will be repeated tomorrow morning at 8:30 in 33/McKinley Peter Torr, Program Manager.
Keywords.
COP 3330 Object-oriented Programming in C++
C Language B. DHIVYA 17PCA140 II MCA.
Gentle* Introduction to Modern C++
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2006
SPL – PS1 Introduction to C++.
Lecture 9 Concepts of Programming Languages
Introduction to Classes and Objects
Presentation transcript:

C++98 Initial Standard ~7 years C++03 Revised standard Limited to bug fixing ~ 5 years TR1 Pure library extension ~3 years C++11 Significant new features to language and library Many more bug fixes than C++03 ~8 years work

 Work under auspices of ISO SC22 WG21  Typically 5-10 national bodies present at any meeting  More participants online  Meet 2-3 times a year for week-long meetings  Typical attendance in range  4 active working groups  Core  Library  Evolution  Concurrency  Work continues online at a slower pace

> 50 New Language Features New Libraries Built on top of a wider set of standards What’s new? Revised Library for new language Resolved several hundred defect reports Cleaned up presentation What’s changed?

 Concepts  Modules  Reflection  Full-featured Garbage Collection  “No New libraries (beyond TR1)”  TR1 math libraries  Becomes its own standard instead

 export  auto to declare local variables  access declarations  Conversion from string literal to ‘char *’  Converts only to ‘char const *’ now  Reference counted strings

 C99 + TC1 + TC2 + Unicode TR  Unicode  ECMAscript regular expressions  Posix  error handling  threads

New Memory Model Define race conditions Limit optimisations within a single thread Thread local storage Parallel initialization/shutdown Low level primitives atomic operations and fences thread wrappers Mutexes and locks High level primitives Futures asynch

Incidental Programmer Ease of use Syntax cleanup Large Scale systems Program Correctness Expressiveness Interoperability Performance Efficiency Concurrency

Declarations auto alias templates raw string literals UTF8 literals Initialization delegating constructors forwarding constructors member initializers list initialization Facilities garbage collection new for- loop lambda expressions

Simplified rules.template typename right-angle-brackets reference collapsing nested classes are members extended SFINAE Extended syntax Consistent initialization default template parameters for function templates sizeof (non-static) data members linkage for local templates

 explicit override ‘keyword’  nullptr  strong enum  forwarding constructors ('strong' typedef)  static_assert  explicit conversion functions  conditionally supported behavior -> more diagnosable errors  deleted functions  detect array-new overflow  detect narrowing conversions (with new syntax)  noexcept destructors

 New data types  long long  char16_t  char32_t  extended integral types  decltype  auto function declarations  extended friends  extern template  variadic templates  variadic macros  _Pragma  move semantics  perfect forwarding  defaulted functions  user defined literals  initializer lists  attributes  trivial types  fixed-base for enums  forward declare enums  enum class

long Unicode char typesStandard layout typesAlignment specifiersC99 preprocessor

Serial rvalue references constexpr trivial types noexcept final virtual functions alignment control Concurrent memory model thread local storage atomic operations

 inline namespaces  exception cloning  native support for type traits  __func__ and updated assert macro  implicit move constructor  implicit move-assignment operator  reference qualifiers  anonymous namespace has internal linkage  concatenate string literals of different type

 Almost doubled in size (by page count)  Huge effort to clean up specification  Simplify through use of common definitions  More precise contracts, using those terms  Learned a lot from the ‘concept’ experiments  Resolved roughly 6x as many issues as TC1  (although many came from new features as library evolved!)

Incidental Programmer New Library Components Enhanced APIs Large Scale systems Support wider standards Better error detection Enhanced resource management Performance Apply new language features Concurrency

 rvalue references  variadic templates  sequence constructors  constexpr  long long and extended integral types  Unicode character types  explicit bool conversion operators  deleted copy semantics  noexcept  nullptr

 exception cloning  initializer lists  range-based for loop  garbage collection

 shared_ptr  binders  function  array  unordered (hashing) containers  tuple  random numbers  regular expressions  type traits  Adopt C99 library

 unique_ptr and move_iterator  forward_list  atomic primitives  thread launching  thread synchronization  futures and asynch  time interval support  compile-time ratio arithmetic  clocks  portable handling of system errors  nested_exception  type_index

 all_of/any_of/none_of  find_if_not  copy_n/copy_if  move / move_backward  partition_copy  is_partitioned/partition_point  is_sorted/is_sorted_until  is_heap/is_heap_until  next/prev  iota  minmax / minmax_element  variadic min/max/minmax  uninitialized_copy_n

 emplace  cbegin/cend  consistent const_iterator to locate elements  consistent overload on std::string as well as const char *  thread-safe strings (no reference counting)  simple numeric string / std::string conversions  code conversion for wide/narrow strings  new facets : time and money  better floating point support (iostream flags / num limits)  allocator upgrade

 move semantics  random numbers  allocator for shared_ptr/function  shared_ptr aliasing  shared_ptr factories  atomic shared_ptr interface  more type traits : decay/conditional/enable_if  alignment calculators (type traits)  tuple concatenation  equality comparison of hashing containers

 basic thread-safe guarantee through library  Can safely use any library object from a single thread without locking  Sharing an object between threads requires user to synchronize access  Read-only access generally safe without locking, but a single write means reads must synchronize too!  basic_string cannot be copy-on-write  shared_ptr must have thread-safe reference counting  thread-safe access to handler functions, e.g. at_exit

 hidden header dependencies  swap now in rather than  C/C++ std header implementations  allocators  vector  bitset constructors  ios_base::failure derives from system_error

 auto_ptr  old function binders  unary/binary_function

 Most modern compilers implement a subset  static_assert  auto  decltype  rvalue references  lambda  gcc 4.6 has widest support  Clang getting good coverage if you want to build your own