104
The new feat ures of C++ 1z( ざざざざ ) Hiroki Gomi @ 530506 http://roki.hateblo.jp / [email protected] m 201x/xx/xx Tokyo Inter Hi gh School GFDL 1.3 with n o Invariant Sectio ns, no Front-Cover Texts, and no Back-Cover Texts.

The new features of C++1z

Embed Size (px)

Citation preview

The new features of C++1z (C++17)

The new features of C++1z() Hiroki Gomi@530506 http://roki.hateblo.jp/[email protected]

201x/xx/xxTokyo Inter High School GFDL 1.3 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

1 2 C++3 ()+ + +

(Hiroki Gomi)C++

()

C++

(C++)()

- Wikipedia C++

() - Wikipedia C++ C++/

Syntax

1

2

()

3

()

Src: computer LanguageBenchmarks Game

C++

(C++)()

- Wikipedia C++

C++1998/9/1ISO/IEC 14882:1998C++982003/10/16ISO/IEC 14882:2003C++032007/11/15ISO/IEC TR 19768:2007C++TR12011/9/1ISO/IEC 14882:2011C++112014/12/15ISO/IEC 14882:2014C++142017C++1z(C++17)

()

2017712C++DraftISOC++1zSyntax

C++er

()The new features of C++1z

N3928static_assert

()

C++1z

OK

N2672

auto

N4295 Fold expression

sum

Fold expressionC++1z

Foldpush_back

N4230Nested namespace definition

C++1z

P0061R1__has_include

P0068[[fallthrough]],[[nodiscard]],[[maybe_unused]],

Casebreakreturn

P0170R1constexpr lambda

constexprlambdalambdaconstexprconstexpr

P0018R3lambda*thiscopy capture

C++14thisC++1zlambda*this

tmp.this->f()tmp.(*this)

hexClass templatetemplate argumentsautoif constexprInline variable

(if constexpr)

()The new features of C++1z

P0006R0traits_wrapper

traits::value

N3824make_array

Tuplepair

array

C++1z

ISOC++1z(17)array(experimental)experimentalstd::array

N4280Non member size() and more

size()

C++1z

size

data()empty()

N3804any

boost C++ librariesboost::anyboost::anyclear,emptymake_anyemplace

P0307R2optional

boost C++ librariesoptional-1nulloptoptional

P0088R3variant

boost C++ librariesvariant

N3069String_view

Charstd::stringstd::string

P0220R1sample

P0220R1apply

Tuple

P0025R0clamp

()

gcd,lcmnot1,not2not_fnShared_ptrtypedefweak_typeweak_ptrvector,list,forward_listConstexpr assert

75

The new features of C++1z

1P0001R0Register

CPU

Register Register movlRegister()

CPU

RegisterC++98-C++03-C++TR1-C++11DeprecatedC++14Deprecated

2011

CPUC++1z

2P0002R0Bool

BoolC++98DeprecatedC++03DeprecatedC++TR1DeprecatedC++11DeprecatedC++14Deprecated

C++1z

std::exchange

3P0003R0

SyntaxSyntaxC++1z

4N4190auto_ptr,bind1st,bind2nd,ptr_fun,mem_fun,mem_fun_ref,random_shuffle

auto_ptr

/auto_ptrdeprecatedC++1z

auto_ptrunique_ptrmove

bind1st,bind2nd

bind1st,bind2ndalgorithmC++03

bind

C++11bindbind1st,bind2ndC++11C++14deprecate

bind1st,bind2nd

bind1st,bind2ndalgorithmC++03C++1z

ptr_fun

not1,not2not_fnDeprecatedPtr_fun

C++1znot_fnC++1z

mem_fun,mem_fun_ref

mem_fn

mem_fun,mem_fun_ref

C++11C++14deprecatedC++1z

bind(mem_fnmem_fn)

Random_shuffleCstd::rand()std::srand()[0,RAND_MAX(32767)]staticstd::ramdom_shufflestd::rand()std::srand()C++14deprecateC++1z

std::fhuffle()

unary_function,binary_function

http://isocpp.orgC++githttp://isocpp.org/forums