SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

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