ILE C/C++ Language Reference, SC09-7852

Total Page:16

File Type:pdf, Size:1020Kb

ILE C/C++ Language Reference, SC09-7852 IBM IBM i Websphere Development Studio ILE C/C++ Language Reference 7.1 SC09-7852-02 IBM IBM i Websphere Development Studio ILE C/C++ Language Reference 7.1 SC09-7852-02 Note! Before using this information and the product it supports, be sure to read the general information under “Notices” on page 355. This edition applies to IBM i 7.1, (program 5770-WDS), ILE C/C++ compilers, and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. © Copyright IBM Corporation 1998, 2010. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About ILE C/C++ Language Reference Digraph characters ........... 27 (SC09-7852-01) ........... ix Trigraph sequences ........... 28 Who should read this book ......... ix Comments............... 28 Highlighting Conventions .......... x How to Read the Syntax Diagrams ....... x Chapter 3. Data objects and Prerequisite and related information ...... xii declarations ............ 31 How to send your comments ........ xii Overview of data objects and declarations .... 31 Overview of data objects ......... 31 What's new for IBM i 7.1 ....... xv Incomplete types .......... 32 Compatible and composite types ..... 32 Chapter 1. Scope and linkage ..... 1 Overview of data declarations and definitions .. 33 Tentative definitions ......... 34 Scope ................. 1 Storage class specifiers........... 35 Block/local scope ............ 2 The auto storage class specifier ....... 35 Function scope ............ 2 Storage duration of automatic variables ... 35 Function prototype scope ......... 3 Linkage of automatic variables ...... 36 File/global scope ............ 3 The static storage class specifier ...... 36 Examples of scope in C .......... 3 Linkage of static variables ....... 36 Class scope (C++ only) .......... 4 The extern storage class specifier ...... 37 Namespaces of identifiers ......... 5 Storage duration of external variables ... 37 Name hiding (C++ only) ......... 6 Linkage of external variables ...... 37 Program linkage ............. 6 The mutable storage class specifier (C++ only).. 38 Internal linkage ............ 7 The register storage class specifier ...... 38 External linkage ............ 7 Storage duration of register variables .... 39 No linkage .............. 8 Linkage of register variables ....... 39 Language linkage............ 8 The __thread storage class specifier ..... 39 Name mangling (C++ only) ....... 9 Type specifiers ............. 40 Integral types............. 40 Chapter 2. Lexical Elements ..... 11 Boolean types ............ 41 Tokens ................ 11 Floating-point types .......... 41 Keywords .............. 11 Real floating-point types ........ 42 Keywords for language extensions..... 12 Character types ............ 43 Identifiers .............. 12 The void type ............ 43 Characters in identifiers ........ 13 Compatibility of arithmetic types (C only) ... 43 Reserved identifiers ......... 13 User-defined types ............ 44 The __func__ predefined identifier..... 14 Structures and unions .......... 44 Literals ............... 14 Structure and union type definition .... 44 Integer literals ........... 15 Member declarations ......... 45 Decimal integer literals ....... 15 Flexible array members ....... 46 Hexadecimal integer literals ...... 16 Zero-extent array members ...... 47 Octal integer literals ........ 16 Bit field members ......... 47 Boolean literals ........... 16 Structure and union variable declarations .. 49 Floating-point literals ......... 17 Structure and union type and variable Binary floating-point literals ...... 17 definitions in a single statement ..... 50 Hexadecimal floating-point literals ... 18 Access to structure and union members ... 50 Decimal floating-point literals ..... 19 Anonymous unions.......... 51 Packed Decimal Literals ........ 20 Enumerations............. 51 Character literals .......... 20 Enumeration type definition ....... 51 String literals ............ 21 Enumeration members........ 52 String concatenation ........ 22 Enumeration variable declarations ..... 53 Punctuators and operators ........ 23 Enumeration type and variable definitions in a Alternative tokens .......... 23 single statement ........... 53 Source program character set ........ 24 Compatibility of structures, unions, and Multibyte characters .......... 25 enumerations (C only) .......... 54 Escape sequences ........... 26 Compatibility across separate source files .. 54 The Unicode standard .......... 26 © Copyright IBM Corp. 1998, 2010 iii typedef definitions ........... 55 Primary expressions ........... 96 Examples of typedef definitions ..... 55 Names ............... 96 Type qualifiers ............. 56 Literals ............... 97 The __align type qualifier ........ 57 Integer constant expressions ........ 97 Examples using the __align qualifier .... 58 Identifier expressions (C++ only) ...... 98 The const type qualifier ......... 59 Parenthesized expressions ( ) ....... 98 The restrict type qualifier ......... 60 Scope resolution operator :: (C++ only) .... 99 The volatile type qualifier ........ 61 Function call expressions ......... 100 Type attributes ............. 61 Member expressions ........... 101 The aligned type attribute ........ 62 Dot operator . ............ 101 The packed type attribute ........ 63 Arrow operator −> .......... 101 The transparent_union type attribute (C only) .. 63 Unary expressions ............ 101 Increment operator ++ ......... 102 Chapter 4. Declarators ........ 65 Decrement operator −− ......... 102 Overview of declarators .......... 65 Unary plus operator + ......... 103 Examples of declarators ......... 66 Unary minus operator - ......... 103 Type names .............. 67 Logical negation operator ! ........ 103 Pointers ............... 68 Bitwise negation operator ~ ....... 104 Pointer arithmetic ........... 69 Address operator & .......... 104 Type-based aliasing........... 70 Indirection operator *.......... 105 Compatibility of pointers (C only) ...... 71 The typeid operator (C++ only) ...... 105 Arrays ................ 71 The __alignof__ operator ........ 106 Variable length arrays (C++ only) ...... 72 The sizeof operator .......... 107 Compatibility of arrays ......... 73 The __typeof__ operator......... 108 References (C++ only) ........... 74 Binary expressions............ 109 Initializers ............... 74 Assignment operators ......... 110 Initialization and storage classes ...... 75 Simple assignment operator = ...... 110 Initialization of automatic variables .... 75 Compound assignment operators ..... 110 Initialization of static variables ...... 75 Multiplication operator *......... 111 Initialization of external variables ..... 76 Division operator / .......... 112 Initialization of register variables ..... 76 Remainder operator % ......... 112 Initialization of structures and unions .... 76 Addition operator + .......... 112 Initialization of enumerations ....... 78 Subtraction operator − ......... 113 Initialization of pointers ......... 78 Bitwise left and right shift operators << >> .. 113 Initialization of arrays .......... 78 Relational operators < > <= >= ...... 114 Initialization of character arrays ..... 79 Equality and inequality operators == != ... 115 Initialization of multidimensional arrays... 80 Bitwise AND operator & ........ 115 Initialization of references (C++ only)..... 81 Bitwise exclusive OR operator ^ ...... 116 Direct binding ........... 82 Bitwise inclusive OR operator | ...... 116 Variable attributes ............ 82 Logical AND operator && ........ 117 The aligned variable attribute ....... 83 Logical OR operator || ......... 117 The packed variable attribute ....... 84 Array subscripting operator [ ] ...... 118 The mode variable attribute ........ 84 Comma operator , ........... 119 The weak variable attribute ........ 85 Pointer to member operators .* −>* (C++ only) 121 Conditional expressions .......... 121 Chapter 5. Type conversions ..... 87 Types in conditional C expressions ..... 122 Types in conditional C++ expressions .... 122 Arithmetic conversions and promotions ..... 87 Examples of conditional expressions..... 122 Integral conversions .......... 87 Cast expressions ............ 123 Boolean conversions .......... 88 Cast operator ()............ 123 Floating-point conversions ........ 88 The static_cast operator (C++ only) ..... 125 Integral and floating-point promotions .... 89 The reinterpret_cast operator (C++ only) ... 126 Lvalue-to-rvalue conversions ........ 90 The const_cast operator (C++ only) ..... 127 Pointer conversions............ 90 The dynamic_cast operator (C++ only) .... 128 Conversion to void* .......... 91 Compound literal expressions ........ 130 Reference conversions (C++ only) ....... 92 new expressions (C++ only) ........ 130 Qualification conversions (C++ only) ...... 92 Placement syntax ........... 132 Function argument conversions........ 92 Initialization of objects created with the new operator .............. 133 Chapter 6. Expressions and operators 95 Handling new allocation failure ...... 133 Lvalues and rvalues ........... 95 delete expressions (C++ only) ........ 134 iv ILE C/C++ Language Reference throw expressions (C++ only) ........ 135 Allocation and deallocation functions (C++ only) 178 Operator precedence and associativity ..... 135 Default arguments in C++ functions (C++ only) 179 Restrictions on default
Recommended publications
  • Javascript • Data Types • Operators • Control Statement • Popup Boxes • Functions • Arrays
    LECTURE-2 Javascript • Data types • Operators • Control Statement • Popup Boxes • Functions • Arrays CS3101: Programming Languages: Javascript Ramana Isukapalli 1 JAVASCRIPT – OVERVIEW • This course is concerned with client side JS • Executes on client (browser) • Scripting – NOT compile/link. • Helps provide dynamic nature of HTML pages. • Included as part of HTML pages as • Regular code (viewable by user) • A file present in some location. • NOTE: Javascript is NOT the same as JAVA CS3101: Programming Languages: Javascript Ramana Isukapalli 2 A SIMPLE JAVASCRIPT PROGRAM <html> <head> <title> A simple Javascript program </title> </head> <body> <! --The code below in “script” is Javascript code. --> <script> document.write (“A Simple Javascript program”); </script> </body> </html> CS3101: Programming Languages: Javascript Ramana Isukapalli 3 JAVASCRIPT CODE • Javascript code in HTML • Javascript code can be placed in • <head> part of HTML file • Code is NOT executed unless called in <body> part of the file. • <body> part of HTML file – executed along with the rest of body part. • Outside HTML file, location is specified. • Executed when called in <body> CS3101: Programming Languages: Javascript Ramana Isukapalli 4 WAYS OF DEFINING JAVASCRIPT CODE. First: Second: <head> <head> <script type=“text/javascript”> … function foo(…) // defined here </head> <body> </script> <script> </head> function foo(…) // defined here { <body> .. } <script type=“text/javascript”> foo( ) // Called here foo(…) // called here </script> </script> </body> </body>
    [Show full text]
  • Typescript-Handbook.Pdf
    This copy of the TypeScript handbook was created on Monday, September 27, 2021 against commit 519269 with TypeScript 4.4. Table of Contents The TypeScript Handbook Your first step to learn TypeScript The Basics Step one in learning TypeScript: The basic types. Everyday Types The language primitives. Understand how TypeScript uses JavaScript knowledge Narrowing to reduce the amount of type syntax in your projects. More on Functions Learn about how Functions work in TypeScript. How TypeScript describes the shapes of JavaScript Object Types objects. An overview of the ways in which you can create more Creating Types from Types types from existing types. Generics Types which take parameters Keyof Type Operator Using the keyof operator in type contexts. Typeof Type Operator Using the typeof operator in type contexts. Indexed Access Types Using Type['a'] syntax to access a subset of a type. Create types which act like if statements in the type Conditional Types system. Mapped Types Generating types by re-using an existing type. Generating mapping types which change properties via Template Literal Types template literal strings. Classes How classes work in TypeScript How JavaScript handles communicating across file Modules boundaries. The TypeScript Handbook About this Handbook Over 20 years after its introduction to the programming community, JavaScript is now one of the most widespread cross-platform languages ever created. Starting as a small scripting language for adding trivial interactivity to webpages, JavaScript has grown to be a language of choice for both frontend and backend applications of every size. While the size, scope, and complexity of programs written in JavaScript has grown exponentially, the ability of the JavaScript language to express the relationships between different units of code has not.
    [Show full text]
  • Section “Common Predefined Macros” in the C Preprocessor
    The C Preprocessor For gcc version 12.0.0 (pre-release) (GCC) Richard M. Stallman, Zachary Weinberg Copyright c 1987-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled \GNU Free Documentation License". This manual contains no Invariant Sections. The Front-Cover Texts are (a) (see below), and the Back-Cover Texts are (b) (see below). (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Table of Contents 1 Overview :::::::::::::::::::::::::::::::::::::::: 1 1.1 Character sets:::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Initial processing ::::::::::::::::::::::::::::::::::::::::::::::: 2 1.3 Tokenization ::::::::::::::::::::::::::::::::::::::::::::::::::: 4 1.4 The preprocessing language :::::::::::::::::::::::::::::::::::: 6 2 Header Files::::::::::::::::::::::::::::::::::::: 7 2.1 Include Syntax ::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Include Operation :::::::::::::::::::::::::::::::::::::::::::::: 8 2.3 Search Path :::::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.4 Once-Only Headers::::::::::::::::::::::::::::::::::::::::::::: 9 2.5 Alternatives to Wrapper #ifndef ::::::::::::::::::::::::::::::
    [Show full text]
  • Getting Started with Nxopen
    Getting Started with NX Open Update January 2019 © 2019 Siemens Product Lifecycle Management Software Inc. All rights reserved. Unrestricted Table of Contents Chapter 1: Introduction ....................................... 1 Chapter 8: Simple Solids and Sheets ............... 64 What Is NX Open .............................................................................................. 1 Creating Primitive Solids ........................................................................... 64 Purpose of this Guide ..................................................................................... 1 Sections ............................................................................................................. 65 Where To Go From Here ............................................................................... 1 Extruded Bodies ............................................................................................ 67 Other Documentation .................................................................................... 2 Revolved Bodies ............................................................................................ 68 Example Code .................................................................................................... 3 Chapter 9: Object Properties & Methods .......... 69 Chapter 2: Using the NX Journal Editor ............. 4 NXObject Properties .................................................................................... 69 System Requirement — The .NET Framework ..................................
    [Show full text]
  • Majnemer-Fuzzingclang.Pdf
    Fuzzing Clang to find ABI Bugs David Majnemer What’s in an ABI? • The size, alignment, etc. of types • Layout of records, RTTI, virtual tables, etc. • The decoration of types, functions, etc. • To generalize: anything that you need N > 1 compilers to agree upon C++: A complicated language union U { int a; int b; }; ! int U::*x = &U::a; int U::*y = &U::b; ! Does ‘x’ equal ‘y’ ? We’ve got a standard How hard could it be? “[T]wo pointers to members compare equal if they would refer to the same member of the same most derived object or the same subobject if indirection with a hypothetical object of the associated class type were performed, otherwise they compare unequal.” No ABI correctly implements this. Why does any of this matter? • Data passed across ABI boundaries may be interpreted by another compiler • Unpredictable things may happen if two compilers disagree about how to interpret this data • Subtle bugs can be some of the worst bugs Finding bugs isn’t easy • ABI implementation techniques may collide with each other in unpredictable ways • One compiler permutes field order in structs if the alignment is 16 AND it has an empty virtual base AND it has at least one bitfield member AND … • Some ABIs are not documented • Even if they are, you can’t always trust the documentation What happens if we aren’t proactive • Let users find our bugs for us • This can be demoralizing for users, eroding their trust • Altruistic; we must hope that the user will file the bug • At best, the user’s time has been spent on something they probably didn’t want to do Let computers find the bugs 1.
    [Show full text]
  • Boost.Typeof Arkadiy Vertleyb Peder Holt Copyright © 2004, 2005 Arkadiy Vertleyb, Peder Holt
    Boost.Typeof Arkadiy Vertleyb Peder Holt Copyright © 2004, 2005 Arkadiy Vertleyb, Peder Holt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at ht- tp://www.boost.org/LICENSE_1_0.txt ) Table of Contents Motivation ............................................................................................................................................................ 2 Tutorial ................................................................................................................................................................ 4 Reference ............................................................................................................................................................. 7 AUTO, AUTO_TPL ....................................................................................................................................... 7 COMPLIANT ............................................................................................................................................... 7 INCREMENT_REGISTRATION_GROUP ......................................................................................................... 7 INTEGRAL .................................................................................................................................................. 8 LIMIT_FUNCTION_ARITY ........................................................................................................................... 8 MESSAGES ................................................................................................................................................
    [Show full text]
  • Decltype and Auto (Revision 4) Programming Language C++ Document No: N1705=04-0145
    Decltype and auto (revision 4) Programming Language C++ Document no: N1705=04-0145 Jaakko Järvi Bjarne Stroustrup Gabriel Dos Reis Texas A&M University AT&T Research Texas A&M University College Station, TX and Texas A&M University College Station, TX [email protected] [email protected] [email protected] September 12, 2004 1 Background This document is a revision of the documents N1607=04-0047 [JS04], N1527=03-0110 [JS03], and N1478=03- 0061 [JSGS03], and builds also on [Str02]. We assume the reader is familiar with the motivation for and history behind decltype and auto, and do not include background discussion in this document; see N1607=04-0047 [JS04] for that. We merely summarize, with two examples, the key capabilities that the proposed features would bring to the language: 1. Declaring return types of functions that depend on the parameter types in a non-trivial way: template <class A, class B> auto operator+(const Matrix<A>& a, const Matrix<B>& b) −> Matrix<decltype(a(0, 0) + b(0, 0))>; 2. Deducing the type of a variable from the type of its initializer: template <class A, class B> void foo(const A& a, const B& b) { auto tmp = a ∗ b; ... 1.1 Changes from N1607 Changes to the previous revisions primarily reflect the EWG discussions and results of the straw votes that took place in the Kona and Sydney meetings. In addition, we suggest a change to the rules of decltype for certain built-in operators, and for expressions that refer to member variables. Following is the list of changes from proposal N1607.
    [Show full text]
  • Application Binary Interface for the ARM Architecture
    ABI for the ARM Architecture (Base Standard) Application Binary Interface for the ARM® Architecture The Base Standard Document number: ARM IHI 0036B, current through ABI release 2.10 Date of Issue: 10th October 2008, reissued 24th November 2015 Abstract This document describes the structure of the Application Binary Interface (ABI) for the ARM architecture, and links to the documents that define the base standard for the ABI for the ARM Architecture. The base standard governs inter-operation between independently generated binary files and sets standards common to ARM- based execution environments. Keywords ABI for the ARM architecture, ABI base standard, embedded ABI How to find the latest release of this specification or report a defect in it Please check the ARM Information Center (http://infocenter.arm.com/) for a later release if your copy is more than one year old (navigate to the ARM Software development tools section, ABI for the ARM Architecture subsection). Please report defects in this specification to arm dot eabi at arm dot com. Licence THE TERMS OF YOUR ROYALTY FREE LIMITED LICENCE TO USE THIS ABI SPECIFICATION ARE GIVEN IN SECTION 1.4, Your licence to use this specification (ARM contract reference LEC-ELA-00081 V2.0). PLEASE READ THEM CAREFULLY. BY DOWNLOADING OR OTHERWISE USING THIS SPECIFICATION, YOU AGREE TO BE BOUND BY ALL OF ITS TERMS. IF YOU DO NOT AGREE TO THIS, DO NOT DOWNLOAD OR USE THIS SPECIFICATION. THIS ABI SPECIFICATION IS PROVIDED “AS IS” WITH NO WARRANTIES (SEE SECTION 1.4 FOR DETAILS). Proprietary notice ARM, Thumb, RealView, ARM7TDMI and ARM9TDMI are registered trademarks of ARM Limited.
    [Show full text]
  • Application Binary Interface Compatability Through A
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by The University of Utah: J. Willard Marriott Digital Library APPLICATION BINARY INTERFACE COMPATIBILITY THROUGH A CUSTOMIZABLE LANGUAGE by Kevin Jay Atkinson A dissertation submitted to the faculty of The University of Utah in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science School of Computing The University of Utah December 2011 Copyright c Kevin Jay Atkinson 2011 All Rights Reserved The University of Utah Graduate School STATEMENT OF DISSERTATION APPROVAL The dissertation of Kevin Jay Atkinson has been approved by the following supervisory committee members: Matthew Flatt , Chair 11/3/2011 Date Approved Gary Lindstrom , Member 11/17/2011 Date Approved Eric Eide , Member 11/3/2011 Date Approved Robert Kessler , Member 11/3/2011 Date Approved Olin Shivers , Member 11/29/2011 Date Approved and by Al Davis , Chair of the Department of School of Computing and by Charles A. Wight, Dean of The Graduate School. ABSTRACT ZL is a C++-compatible language in which high-level constructs, such as classes, are defined using macros over a C-like core language. This approach is similar in spirit to Scheme and makes many parts of the language easily customizable. For example, since the class construct can be defined using macros, a programmer can have complete control over the memory layout of objects. Using this capability, a programmer can mitigate certain problems in software evolution such as fragile ABIs (Application Binary Interfaces) due to software changes and incompatible ABIs due to compiler changes.
    [Show full text]
  • The Building Blocks: Data Types, Literals, and Variables
    Quigley.book Page 31 Thursday, May 22, 2003 3:19 PM chapter 3 The Building Blocks: Data Types, Literals, and Variables 3.1 Data Types A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validating forms, ad infinitum. But in order to do anything, the program works with the data that is given to it. Data types specify what kind of data, such as numbers and characters, can be stored and manipulated within a program. Java- Script supports a number of fundamental data types. These types can be broken down into two categories, primitive data types and composite data types. 3.1.1 Primitive Data Types Primitive data types are the simplest building blocks of a program. They are types that can be assigned a single literal value such as the number 5.7, or a string of characters such as "hello". JavaScript supports three core or basic data types: • numeric • string • Boolean In addition to the three core data types, there are two other special types that consist of a single value: • null • undefined Numeric Literals. JavaScript supports both integers and floating-point numbers. Integers are whole numbers and do not contain a decimal point; e.g., 123 and –6. Inte- gers can be expressed in decimal (base 10), octal (base 8), and hexadecimal (base 16), and are either positive or negative values. See Example 3.1. 31 Quigley.book Page 32 Thursday, May 22, 2003 3:19 PM 32 Chapter 3 • The Building Blocks: Data Types, Literals, and Variables Floating-point numbers are fractional numbers such as 123.56 or –2.5.
    [Show full text]
  • Linkers and Loaders Do?
    Linkers & Loaders by John R. Levine Table of Contents 1 Table of Contents Chapter 0: Front Matter ........................................................ 1 Dedication .............................................................................................. 1 Introduction ............................................................................................ 1 Who is this book for? ......................................................................... 2 Chapter summaries ............................................................................. 3 The project ......................................................................................... 4 Acknowledgements ............................................................................ 5 Contact us ........................................................................................... 6 Chapter 1: Linking and Loading ........................................... 7 What do linkers and loaders do? ............................................................ 7 Address binding: a historical perspective .............................................. 7 Linking vs. loading .............................................................................. 10 Tw o-pass linking .............................................................................. 12 Object code libraries ........................................................................ 15 Relocation and code modification .................................................... 17 Compiler Drivers .................................................................................
    [Show full text]
  • C++0X Type Inference
    Master seminar C++0x Type Inference Stefan Schulze Frielinghaus November 18, 2009 Abstract This article presents the new type inference features of the up- coming C++ standard. The main focus is on the keywords auto and decltype which introduce basic type inference. Their power but also their limitations are discussed in relation to full type inference of most functional programming languages. 1 Introduction Standard C++ requires explicitly a type for each variable (s. [6, § 7.1.5 clause 2]). There is no exception and especially when types get verbose it is error prone to write them. The upcoming C++ standard, from now on referenced as C++0x, includes a new functionality called type inference to circumvent this problem. Consider the following example: int a = 2; int b = 40; auto c = a + b; In this case the compiler may figure out the type of variable ‘c’ because the type of the rvalue of expression ‘a + b’ is known at compile time. In the end this means that the compiler may look up all variables and function calls of interest to figure out which type an object should have. This is done via type inference and the auto keyword. Often types get verbose when templates are used. These cases demonstrate how useful the auto keyword is. For example, in C++98 and 03 developers often use typedef to circumvent the problem of verbose types: 1 typedef std::vector<std::string> svec; ... svec v = foo(); In C++0x a typedef may be left out in favor of auto: auto v = foo(); In some cases it may reduce the overhead if someone is not familiar with a code and would therefore need to lookup all typedefs (s.
    [Show full text]