SlideShare a Scribd company logo
1 of 26
CPP05 - Standard Library:
STL e boost, la BCL di C++
Alessio Gogna
agogna@gmail.com - @alecsg77

http://alecsg77.net/
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Grazie a
Sponsor

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
italiancpp.org
@italiancpp
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Agenda
•

Sondaggio

•

Introduzione alla C++11 Standard Library

•

Alcune premesse

•

Esempi pratici

•

Introduzione alle boost libraries

•

Esempio pratico

•

Recap

•

Q&A

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Sondaggio
Greatest Common Divisor

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
The C++ Standard Library

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Standard Template Library

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
C++11 Standard Library
Containers

Localizations

Iterators

Regular Expression

Algorithms

Threads

Numerics

Atomic operations

Input/Output

Utilities

Strings

C Standard Library

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
C++11 Standard Library - Perché
Pro
•

Generiche

Contro
•

 Basate sui Template e function objects
•

Performanti

 Argomenti generici o molto complessi
•

 Supporto dei compilatori
•

Efficienti
Robuste
 Type check a compile-time

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Incompatibilità binaria
 Standard interfacce e comportamenti

•

 Code inlining
•

Minor supporto Intellisense

Debug più difficile
 Decisioni di flusso a compile-time

•

Errori complessi
 Metaprogramming avanzata
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Alcune premesse
Prima di vedere del codice

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
String
Type

Definition

string

basic_string<char>

wstring

basic_string<wchar_t>

u16string

basic_string<char16_t>

u32string

basic_string<char32_t>

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Input/Output

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Containers
Sequence containers
array

static contiguous array

vector

dynamic contiguous array

deque

double-ended queue

forward_list

singly-linked list

list

doubly-linked list

Container adaptors
stack

adapts a container to provide stack (LIFO data structure)

queue

adapts a container to provide queue (FIFO data structure)

priority_queue

adapts a container to provide priority queue

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Containers
Associative containers
set

unique keys, sorted by keys

map

key-value pairs, sorted by keys, keys are unique

multiset

keys, sorted by keys

multimap

key-value pairs, sorted by keys

Unordered Associative containers
unordered_set

unique keys, hashed by keys

unordered_map

key-value pairs, hashed by keys, keys are unique

unordered_multiset

keys, hashed by keys

unordered_multimap

key-value pairs, hashed by keys

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Iterators

Random
Bidirectional
Forward

Input
#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Output
Algorithms
Classificazione

Algoritmi

Non-modifying sequence

all_of, any_of, none_of, for_each, count, count_if, mismatch, equal, find, find_if, find_if_not, find_end,
find_first_of, adjacent_find, search, search_n

Modifying sequence

copy, copy_if, copy_n, copy_backward, move, move_backward, fill, fill_n, transform, generate,
generate_n, remove, remove_if, remove_copy, remove_copy_if, replace, replace_if, replace_copy,
replace_copy_if, swap, swap_ranges, iter_swap, reverse, reverse_copy, rotate, rotate_copy,
random_shuffle, shuffle, unique, unique_copy

Partitioning

is_partitioned, partition, partition_copy, stable_partition, partition_point

Sorting

is_sorted, is_sorted_until, sort, partial_sort, partial_sort_copy, stable_sort, nth_element

Sorted range

lower_bound, upper_bound, binary_search, equal_range, merge, inplace_merge, includes,
set_difference, set_intersection, set_symmetric_difference, set_union

Heap

is_heap, is_heap_until, make_heap, push_heap, pop_heap, sort_heap

Minimum/maximum

max, max_element, min, min_element, minmax, minmax_element, lexicographical_compare,
is_permutation, next_permutation, prev_permutation

Generic Numeric

iota, partial_sum, accumulate, inner_product, adjacent_difference

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Esempi pratici
Finalmente un po’ di codice

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
INTERESSANTE...

…SICURO NON
MANCHI NULLA?
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
boost

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
C++11 Standard Library
Containers

Localizations

Iterators

Regular Expression

Algorithms

Threads

Numerics

Atomic operations

Input/Output

Utilities

Strings

C Standard Library

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
boost – Categorie
String and text processing

Concurrent Programming

Memory

Containers

Math and numerics

Parsing

Iterators

Correctness and testing

Patterns and Idioms

Algorithms

Data structures

Programming Interfaces

Function objects and
higher-order programming

Domain Specific

State Machines

Image processing

System

Input/Output

Miscellaneous

Inter-language support

Broken compiler
workarounds

Generic Programming
Template Metaprogramming

Preprocessor
Metaprogramming

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Language Features
Emulation
boost – Librerie
Accumulators
Algorithm
Any
Array
Asio
Assign
Atomic
Bimap
Bind
Call Traits
Chrono
Circular Buffer
Compatibility
Compressed Pair
Concept Check
Config
Container
Context
Conversion
Coroutine
CRC
Date Time
Dynamic Bitset

Enable If
Interprocess
Exception
Interval
Filesystem
Intrusive
Flyweight
IO State Savers
Foreach
Iostreams
Format
Iterator
Function
Lambda
Function Types
Lexical Cast
Functional
Local Function
Functional/Factory
Locale
Functional/Forward
Lockfree
Functional/Hash
Log
Functional/Overloade
Math
d Function
Math Common
Fusion
Factor
Geometry
Math Octonion
GIL
Math Quaternion
Graph
Math/Special
Heap
Functions
ICL
Math/Statistical
Identity Type
Distributions
In Place Factory
Member Function
Integer
Meta State Machine

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Min-Max
Move
MPI
MPL
Multi-Array
Multi-Index
Multiprecision
Numeric Conversion
Odeint
Operators
Optional
Parameter
Phoenix
Pointer Container
Polygon
Pool
Predef
Preprocessor
Program Options
Property Map
Property Tree
Proto
Python

Random
Range
Ratio
Rational
Ref
Regex
Result Of
Scope Exit
Serialization
Signals2
Smart Ptr
Spirit
Statechart
Static Assert
String Algo
Swap
System
Test
Thread
Timer
Tokenizer
TR1
Tribool

TTI
Tuple
Type Erasure
Type Traits
Typed In Place
Factory
Typeof
uBLAS
Units
Unordered
Utility
Uuid
Value Initialized
Variant
Wave
Xpressive
boost – Perché
Pro
•

Nate per essere standard

Contro
•

 Facilità di utilizzo
•

Collezione di librerie indipendenti

 Medesime problematiche
•

 Compili solo ciò che ti serve
•

Alta qualità
 Review del codice e regression tests

•

Portabilità
 Supporto per vari compilatori e OS

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

Stessi paradigmi di STL
Dimensioni notevoli
 ~10 000 file per ~100 Mb di occupazione

•

Tante librerie
 Difficolta di ricerca e scelta
Esempio pratico
Boost your app!

#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Q&A
Tutto il materiale di questa sessione su

http://www.communitydays.it/
Lascia il feedback su questa sessione,
potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays14

#CDays14 – Milano 25, 26 e 27 Febbraio 2014

More Related Content

Viewers also liked

Administración de empresas – semana 4
Administración de empresas – semana 4Administración de empresas – semana 4
Administración de empresas – semana 4Anuar Almeida
 
Brochure josh Archive!
Brochure josh Archive!Brochure josh Archive!
Brochure josh Archive!it Consult
 
Technology and Protest
Technology and ProtestTechnology and Protest
Technology and Protesttgambee
 
Какую выбрать стратегию молодому маркетологу?
Какую выбрать стратегию молодому маркетологу?Какую выбрать стратегию молодому маркетологу?
Какую выбрать стратегию молодому маркетологу?Tanya Ryzhaya
 
Как начать карьеру в маркетинге?
Как начать карьеру в маркетинге?Как начать карьеру в маркетинге?
Как начать карьеру в маркетинге?Tanya Ryzhaya
 
Presentation kelas 9 bab 3 -MENAMBAH TABEL,GRAFIK DAN DIAGRAM
Presentation kelas 9 bab 3  -MENAMBAH TABEL,GRAFIK DAN DIAGRAMPresentation kelas 9 bab 3  -MENAMBAH TABEL,GRAFIK DAN DIAGRAM
Presentation kelas 9 bab 3 -MENAMBAH TABEL,GRAFIK DAN DIAGRAMamaliadhea
 
Introduction à la recherche d'information avec google
Introduction à la recherche d'information avec googleIntroduction à la recherche d'information avec google
Introduction à la recherche d'information avec googlehamoji hamoji
 

Viewers also liked (9)

Administración de empresas – semana 4
Administración de empresas – semana 4Administración de empresas – semana 4
Administración de empresas – semana 4
 
Brochure josh Archive!
Brochure josh Archive!Brochure josh Archive!
Brochure josh Archive!
 
Technology and Protest
Technology and ProtestTechnology and Protest
Technology and Protest
 
Какую выбрать стратегию молодому маркетологу?
Какую выбрать стратегию молодому маркетологу?Какую выбрать стратегию молодому маркетологу?
Какую выбрать стратегию молодому маркетологу?
 
Как начать карьеру в маркетинге?
Как начать карьеру в маркетинге?Как начать карьеру в маркетинге?
Как начать карьеру в маркетинге?
 
Presentation kelas 9 bab 3 -MENAMBAH TABEL,GRAFIK DAN DIAGRAM
Presentation kelas 9 bab 3  -MENAMBAH TABEL,GRAFIK DAN DIAGRAMPresentation kelas 9 bab 3  -MENAMBAH TABEL,GRAFIK DAN DIAGRAM
Presentation kelas 9 bab 3 -MENAMBAH TABEL,GRAFIK DAN DIAGRAM
 
Tugas dds 3 kelompok v
Tugas dds 3 kelompok vTugas dds 3 kelompok v
Tugas dds 3 kelompok v
 
Fitria utami redhat
Fitria utami redhatFitria utami redhat
Fitria utami redhat
 
Introduction à la recherche d'information avec google
Introduction à la recherche d'information avec googleIntroduction à la recherche d'information avec google
Introduction à la recherche d'information avec google
 

Similar to CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++

Fun with Functional JavaScript - Kuba Waliński - Codemotion Rome 2015
Fun with Functional JavaScript  - Kuba Waliński - Codemotion Rome 2015Fun with Functional JavaScript  - Kuba Waliński - Codemotion Rome 2015
Fun with Functional JavaScript - Kuba Waliński - Codemotion Rome 2015Codemotion
 
Get started with Lua programming
Get started with Lua programmingGet started with Lua programming
Get started with Lua programmingEtiene Dalcol
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigoujaxconf
 
Seamless semantics - avoiding semantic discontinuity
Seamless semantics - avoiding semantic discontinuitySeamless semantics - avoiding semantic discontinuity
Seamless semantics - avoiding semantic discontinuitySteffen Staab
 
HBase and Drill: How loosley typed SQL is ideal for NoSQL
HBase and Drill: How loosley typed SQL is ideal for NoSQLHBase and Drill: How loosley typed SQL is ideal for NoSQL
HBase and Drill: How loosley typed SQL is ideal for NoSQLDataWorks Summit
 
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQL
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQLHBase and Drill: How Loosely Typed SQL is Ideal for NoSQL
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQLMapR Technologies
 
Architectural Patterns for Streaming Applications
Architectural Patterns for Streaming ApplicationsArchitectural Patterns for Streaming Applications
Architectural Patterns for Streaming Applicationshadooparchbook
 
RDF Database-as-a-Service with S4
RDF Database-as-a-Service with S4RDF Database-as-a-Service with S4
RDF Database-as-a-Service with S4Marin Dimitrov
 
Evolving Streaming Applications
Evolving Streaming ApplicationsEvolving Streaming Applications
Evolving Streaming ApplicationsDataWorks Summit
 
Programming in C++ and Data Strucutres
Programming in C++ and Data StrucutresProgramming in C++ and Data Strucutres
Programming in C++ and Data StrucutresDr. C.V. Suresh Babu
 
MLOps journey at Swisscom: AI Use Cases, Architecture and Future Vision
MLOps journey at Swisscom: AI Use Cases, Architecture and Future VisionMLOps journey at Swisscom: AI Use Cases, Architecture and Future Vision
MLOps journey at Swisscom: AI Use Cases, Architecture and Future VisionBATbern
 
A machine learning and data science pipeline for real companies
A machine learning and data science pipeline for real companiesA machine learning and data science pipeline for real companies
A machine learning and data science pipeline for real companiesDataWorks Summit
 
When OLAP Meets Real-Time, What Happens in eBay?
When OLAP Meets Real-Time, What Happens in eBay?When OLAP Meets Real-Time, What Happens in eBay?
When OLAP Meets Real-Time, What Happens in eBay?DataWorks Summit
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph GeneratorLDBC council
 
Mule soft meetup_charlotte_4__draft_v2.0
Mule soft meetup_charlotte_4__draft_v2.0Mule soft meetup_charlotte_4__draft_v2.0
Mule soft meetup_charlotte_4__draft_v2.0Subhash Patel
 
Scalable PHP Applications With Cassandra
Scalable PHP Applications With CassandraScalable PHP Applications With Cassandra
Scalable PHP Applications With CassandraAndrea De Pirro
 
Informatica overview
Informatica overviewInformatica overview
Informatica overviewkarthik kumar
 
Informatica overview
Informatica overviewInformatica overview
Informatica overviewkarthik kumar
 
Graph Databases for SQL Server Professionals - SQLSaturday #350 Winnipeg
Graph Databases for SQL Server Professionals - SQLSaturday #350 WinnipegGraph Databases for SQL Server Professionals - SQLSaturday #350 Winnipeg
Graph Databases for SQL Server Professionals - SQLSaturday #350 WinnipegStéphane Fréchette
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update referencesandeepji_choudhary
 

Similar to CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++ (20)

Fun with Functional JavaScript - Kuba Waliński - Codemotion Rome 2015
Fun with Functional JavaScript  - Kuba Waliński - Codemotion Rome 2015Fun with Functional JavaScript  - Kuba Waliński - Codemotion Rome 2015
Fun with Functional JavaScript - Kuba Waliński - Codemotion Rome 2015
 
Get started with Lua programming
Get started with Lua programmingGet started with Lua programming
Get started with Lua programming
 
The Road to Lambda - Mike Duigou
The Road to Lambda - Mike DuigouThe Road to Lambda - Mike Duigou
The Road to Lambda - Mike Duigou
 
Seamless semantics - avoiding semantic discontinuity
Seamless semantics - avoiding semantic discontinuitySeamless semantics - avoiding semantic discontinuity
Seamless semantics - avoiding semantic discontinuity
 
HBase and Drill: How loosley typed SQL is ideal for NoSQL
HBase and Drill: How loosley typed SQL is ideal for NoSQLHBase and Drill: How loosley typed SQL is ideal for NoSQL
HBase and Drill: How loosley typed SQL is ideal for NoSQL
 
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQL
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQLHBase and Drill: How Loosely Typed SQL is Ideal for NoSQL
HBase and Drill: How Loosely Typed SQL is Ideal for NoSQL
 
Architectural Patterns for Streaming Applications
Architectural Patterns for Streaming ApplicationsArchitectural Patterns for Streaming Applications
Architectural Patterns for Streaming Applications
 
RDF Database-as-a-Service with S4
RDF Database-as-a-Service with S4RDF Database-as-a-Service with S4
RDF Database-as-a-Service with S4
 
Evolving Streaming Applications
Evolving Streaming ApplicationsEvolving Streaming Applications
Evolving Streaming Applications
 
Programming in C++ and Data Strucutres
Programming in C++ and Data StrucutresProgramming in C++ and Data Strucutres
Programming in C++ and Data Strucutres
 
MLOps journey at Swisscom: AI Use Cases, Architecture and Future Vision
MLOps journey at Swisscom: AI Use Cases, Architecture and Future VisionMLOps journey at Swisscom: AI Use Cases, Architecture and Future Vision
MLOps journey at Swisscom: AI Use Cases, Architecture and Future Vision
 
A machine learning and data science pipeline for real companies
A machine learning and data science pipeline for real companiesA machine learning and data science pipeline for real companies
A machine learning and data science pipeline for real companies
 
When OLAP Meets Real-Time, What Happens in eBay?
When OLAP Meets Real-Time, What Happens in eBay?When OLAP Meets Real-Time, What Happens in eBay?
When OLAP Meets Real-Time, What Happens in eBay?
 
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014:  Social Network Benchmark (SNB) Graph GeneratorFOSDEM 2014:  Social Network Benchmark (SNB) Graph Generator
FOSDEM 2014: Social Network Benchmark (SNB) Graph Generator
 
Mule soft meetup_charlotte_4__draft_v2.0
Mule soft meetup_charlotte_4__draft_v2.0Mule soft meetup_charlotte_4__draft_v2.0
Mule soft meetup_charlotte_4__draft_v2.0
 
Scalable PHP Applications With Cassandra
Scalable PHP Applications With CassandraScalable PHP Applications With Cassandra
Scalable PHP Applications With Cassandra
 
Informatica overview
Informatica overviewInformatica overview
Informatica overview
 
Informatica overview
Informatica overviewInformatica overview
Informatica overview
 
Graph Databases for SQL Server Professionals - SQLSaturday #350 Winnipeg
Graph Databases for SQL Server Professionals - SQLSaturday #350 WinnipegGraph Databases for SQL Server Professionals - SQLSaturday #350 Winnipeg
Graph Databases for SQL Server Professionals - SQLSaturday #350 Winnipeg
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
 

Recently uploaded

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++

  • 1. CPP05 - Standard Library: STL e boost, la BCL di C++ Alessio Gogna agogna@gmail.com - @alecsg77 http://alecsg77.net/ #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 2. Grazie a Sponsor #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 4. Agenda • Sondaggio • Introduzione alla C++11 Standard Library • Alcune premesse • Esempi pratici • Introduzione alle boost libraries • Esempio pratico • Recap • Q&A #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 5. Sondaggio Greatest Common Divisor #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 6. The C++ Standard Library #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 7. Standard Template Library #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 8. C++11 Standard Library Containers Localizations Iterators Regular Expression Algorithms Threads Numerics Atomic operations Input/Output Utilities Strings C Standard Library #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 9. C++11 Standard Library - Perché Pro • Generiche Contro •  Basate sui Template e function objects • Performanti  Argomenti generici o molto complessi •  Supporto dei compilatori • Efficienti Robuste  Type check a compile-time #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Incompatibilità binaria  Standard interfacce e comportamenti •  Code inlining • Minor supporto Intellisense Debug più difficile  Decisioni di flusso a compile-time • Errori complessi  Metaprogramming avanzata
  • 10. #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 11. Alcune premesse Prima di vedere del codice #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 13. Input/Output #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 14. Containers Sequence containers array static contiguous array vector dynamic contiguous array deque double-ended queue forward_list singly-linked list list doubly-linked list Container adaptors stack adapts a container to provide stack (LIFO data structure) queue adapts a container to provide queue (FIFO data structure) priority_queue adapts a container to provide priority queue #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 15. Containers Associative containers set unique keys, sorted by keys map key-value pairs, sorted by keys, keys are unique multiset keys, sorted by keys multimap key-value pairs, sorted by keys Unordered Associative containers unordered_set unique keys, hashed by keys unordered_map key-value pairs, hashed by keys, keys are unique unordered_multiset keys, hashed by keys unordered_multimap key-value pairs, hashed by keys #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 17. Algorithms Classificazione Algoritmi Non-modifying sequence all_of, any_of, none_of, for_each, count, count_if, mismatch, equal, find, find_if, find_if_not, find_end, find_first_of, adjacent_find, search, search_n Modifying sequence copy, copy_if, copy_n, copy_backward, move, move_backward, fill, fill_n, transform, generate, generate_n, remove, remove_if, remove_copy, remove_copy_if, replace, replace_if, replace_copy, replace_copy_if, swap, swap_ranges, iter_swap, reverse, reverse_copy, rotate, rotate_copy, random_shuffle, shuffle, unique, unique_copy Partitioning is_partitioned, partition, partition_copy, stable_partition, partition_point Sorting is_sorted, is_sorted_until, sort, partial_sort, partial_sort_copy, stable_sort, nth_element Sorted range lower_bound, upper_bound, binary_search, equal_range, merge, inplace_merge, includes, set_difference, set_intersection, set_symmetric_difference, set_union Heap is_heap, is_heap_until, make_heap, push_heap, pop_heap, sort_heap Minimum/maximum max, max_element, min, min_element, minmax, minmax_element, lexicographical_compare, is_permutation, next_permutation, prev_permutation Generic Numeric iota, partial_sum, accumulate, inner_product, adjacent_difference #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 18. Esempi pratici Finalmente un po’ di codice #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 19. INTERESSANTE... …SICURO NON MANCHI NULLA? #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 20. boost #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 21. C++11 Standard Library Containers Localizations Iterators Regular Expression Algorithms Threads Numerics Atomic operations Input/Output Utilities Strings C Standard Library #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 22. boost – Categorie String and text processing Concurrent Programming Memory Containers Math and numerics Parsing Iterators Correctness and testing Patterns and Idioms Algorithms Data structures Programming Interfaces Function objects and higher-order programming Domain Specific State Machines Image processing System Input/Output Miscellaneous Inter-language support Broken compiler workarounds Generic Programming Template Metaprogramming Preprocessor Metaprogramming #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Language Features Emulation
  • 23. boost – Librerie Accumulators Algorithm Any Array Asio Assign Atomic Bimap Bind Call Traits Chrono Circular Buffer Compatibility Compressed Pair Concept Check Config Container Context Conversion Coroutine CRC Date Time Dynamic Bitset Enable If Interprocess Exception Interval Filesystem Intrusive Flyweight IO State Savers Foreach Iostreams Format Iterator Function Lambda Function Types Lexical Cast Functional Local Function Functional/Factory Locale Functional/Forward Lockfree Functional/Hash Log Functional/Overloade Math d Function Math Common Fusion Factor Geometry Math Octonion GIL Math Quaternion Graph Math/Special Heap Functions ICL Math/Statistical Identity Type Distributions In Place Factory Member Function Integer Meta State Machine #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Min-Max Move MPI MPL Multi-Array Multi-Index Multiprecision Numeric Conversion Odeint Operators Optional Parameter Phoenix Pointer Container Polygon Pool Predef Preprocessor Program Options Property Map Property Tree Proto Python Random Range Ratio Rational Ref Regex Result Of Scope Exit Serialization Signals2 Smart Ptr Spirit Statechart Static Assert String Algo Swap System Test Thread Timer Tokenizer TR1 Tribool TTI Tuple Type Erasure Type Traits Typed In Place Factory Typeof uBLAS Units Unordered Utility Uuid Value Initialized Variant Wave Xpressive
  • 24. boost – Perché Pro • Nate per essere standard Contro •  Facilità di utilizzo • Collezione di librerie indipendenti  Medesime problematiche •  Compili solo ciò che ti serve • Alta qualità  Review del codice e regression tests • Portabilità  Supporto per vari compilatori e OS #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Stessi paradigmi di STL Dimensioni notevoli  ~10 000 file per ~100 Mb di occupazione • Tante librerie  Difficolta di ricerca e scelta
  • 25. Esempio pratico Boost your app! #CDays14 – Milano 25, 26 e 27 Febbraio 2014
  • 26. Q&A Tutto il materiale di questa sessione su http://www.communitydays.it/ Lascia il feedback su questa sessione, potrai essere estratto per i nostri premi! Seguici su Twitter @CommunityDaysIT Facebook http://facebook.com/cdaysit #CDays14 #CDays14 – Milano 25, 26 e 27 Febbraio 2014