- tmp/tmpmzrk8173/{from.md → to.md} +31 -369
tmp/tmpmzrk8173/{from.md → to.md}
RENAMED
|
@@ -28,13 +28,13 @@ namespace std {
|
|
| 28 |
template<class T>
|
| 29 |
constexpr int bit_width(T x) noexcept;
|
| 30 |
|
| 31 |
// [bit.rotate], rotating
|
| 32 |
template<class T>
|
| 33 |
-
|
| 34 |
template<class T>
|
| 35 |
-
|
| 36 |
|
| 37 |
// [bit.count], counting
|
| 38 |
template<class T>
|
| 39 |
constexpr int countl_zero(T x) noexcept;
|
| 40 |
template<class T>
|
|
@@ -66,35 +66,48 @@ template<class To, class From>
|
|
| 66 |
|
| 67 |
- `sizeof(To) == sizeof(From)` is `true`;
|
| 68 |
- `is_trivially_copyable_v<To>` is `true`; and
|
| 69 |
- `is_trivially_copyable_v<From>` is `true`.
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
*Returns:* An object of type `To`. Implicitly creates objects nested
|
| 72 |
within the result [[intro.object]]. Each bit of the value representation
|
| 73 |
of the result is equal to the corresponding bit in the object
|
| 74 |
representation of `from`. Padding bits of the result are unspecified.
|
| 75 |
For the result and each object created within it, if there is no value
|
| 76 |
of the object’s type corresponding to the value representation produced,
|
| 77 |
the behavior is undefined. If there are multiple such values, which
|
| 78 |
value is produced is unspecified. A bit in the value representation of
|
| 79 |
the result is indeterminate if it does not correspond to a bit in the
|
| 80 |
-
value representation of `from` or corresponds to a bit
|
| 81 |
-
is not within its lifetime or has an
|
| 82 |
-
value [[basic.indet]].
|
| 83 |
-
|
| 84 |
-
has an
|
| 85 |
-
|
| 86 |
-
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
- `is_member_pointer_v<T>` is `false`;
|
| 94 |
-
- `is_volatile_v<T>` is `false`; and
|
| 95 |
-
- `T` has no non-static data members of reference type.
|
| 96 |
|
| 97 |
### `byteswap` <a id="bit.byteswap">[[bit.byteswap]]</a>
|
| 98 |
|
| 99 |
``` cpp
|
| 100 |
template<class T>
|
|
@@ -167,11 +180,11 @@ template<class T>
|
|
| 167 |
In the following descriptions, let `N` denote
|
| 168 |
`numeric_limits<T>::digits`.
|
| 169 |
|
| 170 |
``` cpp
|
| 171 |
template<class T>
|
| 172 |
-
|
| 173 |
```
|
| 174 |
|
| 175 |
*Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
|
| 176 |
|
| 177 |
Let `r` be `s % N`.
|
|
@@ -179,11 +192,11 @@ Let `r` be `s % N`.
|
|
| 179 |
*Returns:* If `r` is `0`, `x`; if `r` is positive,
|
| 180 |
`(x << r) | (x >> (N - r))`; if `r` is negative, `rotr(x, -r)`.
|
| 181 |
|
| 182 |
``` cpp
|
| 183 |
template<class T>
|
| 184 |
-
|
| 185 |
```
|
| 186 |
|
| 187 |
*Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
|
| 188 |
|
| 189 |
Let `r` be `s % N`.
|
|
@@ -279,356 +292,5 @@ If all scalar types have size 1 byte, then all of `endian::little`,
|
|
| 279 |
big-endian, `endian::native` is equal to `endian::big`. If all scalar
|
| 280 |
types are little-endian, `endian::native` is equal to `endian::little`.
|
| 281 |
Otherwise, `endian::native` is not equal to either `endian::big` or
|
| 282 |
`endian::little`.
|
| 283 |
|
| 284 |
-
<!-- Link reference definitions -->
|
| 285 |
-
[algorithms]: algorithms.md#algorithms
|
| 286 |
-
[algorithms.general]: algorithms.md#algorithms.general
|
| 287 |
-
[algorithms.requirements]: algorithms.md#algorithms.requirements
|
| 288 |
-
[allocator.requirements.general]: library.md#allocator.requirements.general
|
| 289 |
-
[allocator.uses.construction]: mem.md#allocator.uses.construction
|
| 290 |
-
[any]: #any
|
| 291 |
-
[any.assign]: #any.assign
|
| 292 |
-
[any.bad.any.cast]: #any.bad.any.cast
|
| 293 |
-
[any.class]: #any.class
|
| 294 |
-
[any.class.general]: #any.class.general
|
| 295 |
-
[any.cons]: #any.cons
|
| 296 |
-
[any.general]: #any.general
|
| 297 |
-
[any.modifiers]: #any.modifiers
|
| 298 |
-
[any.nonmembers]: #any.nonmembers
|
| 299 |
-
[any.observers]: #any.observers
|
| 300 |
-
[any.synop]: #any.synop
|
| 301 |
-
[arithmetic.operations]: #arithmetic.operations
|
| 302 |
-
[arithmetic.operations.divides]: #arithmetic.operations.divides
|
| 303 |
-
[arithmetic.operations.general]: #arithmetic.operations.general
|
| 304 |
-
[arithmetic.operations.minus]: #arithmetic.operations.minus
|
| 305 |
-
[arithmetic.operations.modulus]: #arithmetic.operations.modulus
|
| 306 |
-
[arithmetic.operations.multiplies]: #arithmetic.operations.multiplies
|
| 307 |
-
[arithmetic.operations.negate]: #arithmetic.operations.negate
|
| 308 |
-
[arithmetic.operations.plus]: #arithmetic.operations.plus
|
| 309 |
-
[associative]: containers.md#associative
|
| 310 |
-
[basic.fundamental]: basic.md#basic.fundamental
|
| 311 |
-
[basic.indet]: basic.md#basic.indet
|
| 312 |
-
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 313 |
-
[basic.types.general]: basic.md#basic.types.general
|
| 314 |
-
[bit]: #bit
|
| 315 |
-
[bit.byteswap]: #bit.byteswap
|
| 316 |
-
[bit.cast]: #bit.cast
|
| 317 |
-
[bit.count]: #bit.count
|
| 318 |
-
[bit.endian]: #bit.endian
|
| 319 |
-
[bit.general]: #bit.general
|
| 320 |
-
[bit.pow.two]: #bit.pow.two
|
| 321 |
-
[bit.rotate]: #bit.rotate
|
| 322 |
-
[bit.syn]: #bit.syn
|
| 323 |
-
[bitmask.types]: library.md#bitmask.types
|
| 324 |
-
[bitset]: #bitset
|
| 325 |
-
[bitset.cons]: #bitset.cons
|
| 326 |
-
[bitset.hash]: #bitset.hash
|
| 327 |
-
[bitset.members]: #bitset.members
|
| 328 |
-
[bitset.operators]: #bitset.operators
|
| 329 |
-
[bitset.syn]: #bitset.syn
|
| 330 |
-
[bitwise.operations]: #bitwise.operations
|
| 331 |
-
[bitwise.operations.and]: #bitwise.operations.and
|
| 332 |
-
[bitwise.operations.general]: #bitwise.operations.general
|
| 333 |
-
[bitwise.operations.not]: #bitwise.operations.not
|
| 334 |
-
[bitwise.operations.or]: #bitwise.operations.or
|
| 335 |
-
[bitwise.operations.xor]: #bitwise.operations.xor
|
| 336 |
-
[charconv]: #charconv
|
| 337 |
-
[charconv.from.chars]: #charconv.from.chars
|
| 338 |
-
[charconv.syn]: #charconv.syn
|
| 339 |
-
[charconv.to.chars]: #charconv.to.chars
|
| 340 |
-
[class.base.init]: class.md#class.base.init
|
| 341 |
-
[class.copy.ctor]: class.md#class.copy.ctor
|
| 342 |
-
[comparisons]: #comparisons
|
| 343 |
-
[comparisons.equal.to]: #comparisons.equal.to
|
| 344 |
-
[comparisons.general]: #comparisons.general
|
| 345 |
-
[comparisons.greater]: #comparisons.greater
|
| 346 |
-
[comparisons.greater.equal]: #comparisons.greater.equal
|
| 347 |
-
[comparisons.less]: #comparisons.less
|
| 348 |
-
[comparisons.less.equal]: #comparisons.less.equal
|
| 349 |
-
[comparisons.not.equal.to]: #comparisons.not.equal.to
|
| 350 |
-
[comparisons.three.way]: #comparisons.three.way
|
| 351 |
-
[concepts.equality]: concepts.md#concepts.equality
|
| 352 |
-
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 353 |
-
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 354 |
-
[cpp17.defaultconstructible]: #cpp17.defaultconstructible
|
| 355 |
-
[cpp17.destructible]: #cpp17.destructible
|
| 356 |
-
[cpp17.hash]: #cpp17.hash
|
| 357 |
-
[cpp17.moveassignable]: #cpp17.moveassignable
|
| 358 |
-
[cpp17.moveconstructible]: #cpp17.moveconstructible
|
| 359 |
-
[dcl.constexpr]: dcl.md#dcl.constexpr
|
| 360 |
-
[dcl.init.general]: dcl.md#dcl.init.general
|
| 361 |
-
[declval]: #declval
|
| 362 |
-
[defns.expression.equivalent]: intro.md#defns.expression.equivalent
|
| 363 |
-
[defns.ntcts]: intro.md#defns.ntcts
|
| 364 |
-
[defns.order.ptr]: #defns.order.ptr
|
| 365 |
-
[defns.referenceable]: intro.md#defns.referenceable
|
| 366 |
-
[except.terminate]: except.md#except.terminate
|
| 367 |
-
[execpol]: #execpol
|
| 368 |
-
[execpol.general]: #execpol.general
|
| 369 |
-
[execpol.objects]: #execpol.objects
|
| 370 |
-
[execpol.par]: #execpol.par
|
| 371 |
-
[execpol.parunseq]: #execpol.parunseq
|
| 372 |
-
[execpol.seq]: #execpol.seq
|
| 373 |
-
[execpol.type]: #execpol.type
|
| 374 |
-
[execpol.unseq]: #execpol.unseq
|
| 375 |
-
[execution.syn]: #execution.syn
|
| 376 |
-
[expected]: #expected
|
| 377 |
-
[expected.bad]: #expected.bad
|
| 378 |
-
[expected.bad.void]: #expected.bad.void
|
| 379 |
-
[expected.expected]: #expected.expected
|
| 380 |
-
[expected.general]: #expected.general
|
| 381 |
-
[expected.object.assign]: #expected.object.assign
|
| 382 |
-
[expected.object.cons]: #expected.object.cons
|
| 383 |
-
[expected.object.dtor]: #expected.object.dtor
|
| 384 |
-
[expected.object.eq]: #expected.object.eq
|
| 385 |
-
[expected.object.general]: #expected.object.general
|
| 386 |
-
[expected.object.monadic]: #expected.object.monadic
|
| 387 |
-
[expected.object.obs]: #expected.object.obs
|
| 388 |
-
[expected.object.swap]: #expected.object.swap
|
| 389 |
-
[expected.syn]: #expected.syn
|
| 390 |
-
[expected.un.cons]: #expected.un.cons
|
| 391 |
-
[expected.un.eq]: #expected.un.eq
|
| 392 |
-
[expected.un.general]: #expected.un.general
|
| 393 |
-
[expected.un.obs]: #expected.un.obs
|
| 394 |
-
[expected.un.swap]: #expected.un.swap
|
| 395 |
-
[expected.unexpected]: #expected.unexpected
|
| 396 |
-
[expected.void]: #expected.void
|
| 397 |
-
[expected.void.assign]: #expected.void.assign
|
| 398 |
-
[expected.void.cons]: #expected.void.cons
|
| 399 |
-
[expected.void.dtor]: #expected.void.dtor
|
| 400 |
-
[expected.void.eq]: #expected.void.eq
|
| 401 |
-
[expected.void.general]: #expected.void.general
|
| 402 |
-
[expected.void.monadic]: #expected.void.monadic
|
| 403 |
-
[expected.void.obs]: #expected.void.obs
|
| 404 |
-
[expected.void.swap]: #expected.void.swap
|
| 405 |
-
[expr.add]: expr.md#expr.add
|
| 406 |
-
[expr.bit.and]: expr.md#expr.bit.and
|
| 407 |
-
[expr.call]: expr.md#expr.call
|
| 408 |
-
[expr.const]: expr.md#expr.const
|
| 409 |
-
[expr.eq]: expr.md#expr.eq
|
| 410 |
-
[expr.log.and]: expr.md#expr.log.and
|
| 411 |
-
[expr.log.or]: expr.md#expr.log.or
|
| 412 |
-
[expr.mul]: expr.md#expr.mul
|
| 413 |
-
[expr.or]: expr.md#expr.or
|
| 414 |
-
[expr.rel]: expr.md#expr.rel
|
| 415 |
-
[expr.unary.op]: expr.md#expr.unary.op
|
| 416 |
-
[expr.xor]: expr.md#expr.xor
|
| 417 |
-
[format]: #format
|
| 418 |
-
[format.align]: #format.align
|
| 419 |
-
[format.arg]: #format.arg
|
| 420 |
-
[format.arg.store]: #format.arg.store
|
| 421 |
-
[format.args]: #format.args
|
| 422 |
-
[format.arguments]: #format.arguments
|
| 423 |
-
[format.context]: #format.context
|
| 424 |
-
[format.err.report]: #format.err.report
|
| 425 |
-
[format.error]: #format.error
|
| 426 |
-
[format.escape.sequences]: #format.escape.sequences
|
| 427 |
-
[format.fmt.string]: #format.fmt.string
|
| 428 |
-
[format.formattable]: #format.formattable
|
| 429 |
-
[format.formatter]: #format.formatter
|
| 430 |
-
[format.formatter.spec]: #format.formatter.spec
|
| 431 |
-
[format.functions]: #format.functions
|
| 432 |
-
[format.parse.ctx]: #format.parse.ctx
|
| 433 |
-
[format.range]: #format.range
|
| 434 |
-
[format.range.fmtdef]: #format.range.fmtdef
|
| 435 |
-
[format.range.fmtkind]: #format.range.fmtkind
|
| 436 |
-
[format.range.fmtmap]: #format.range.fmtmap
|
| 437 |
-
[format.range.fmtset]: #format.range.fmtset
|
| 438 |
-
[format.range.fmtstr]: #format.range.fmtstr
|
| 439 |
-
[format.range.formatter]: #format.range.formatter
|
| 440 |
-
[format.sign]: #format.sign
|
| 441 |
-
[format.string]: #format.string
|
| 442 |
-
[format.string.escaped]: #format.string.escaped
|
| 443 |
-
[format.string.general]: #format.string.general
|
| 444 |
-
[format.string.std]: #format.string.std
|
| 445 |
-
[format.syn]: #format.syn
|
| 446 |
-
[format.tuple]: #format.tuple
|
| 447 |
-
[format.type.bool]: #format.type.bool
|
| 448 |
-
[format.type.char]: #format.type.char
|
| 449 |
-
[format.type.float]: #format.type.float
|
| 450 |
-
[format.type.int]: #format.type.int
|
| 451 |
-
[format.type.ptr]: #format.type.ptr
|
| 452 |
-
[format.type.string]: #format.type.string
|
| 453 |
-
[formatter]: #formatter
|
| 454 |
-
[formatter.basic]: #formatter.basic
|
| 455 |
-
[formatter.range.type]: #formatter.range.type
|
| 456 |
-
[formatter.requirements]: #formatter.requirements
|
| 457 |
-
[formatter.tuple.type]: #formatter.tuple.type
|
| 458 |
-
[forward]: #forward
|
| 459 |
-
[freestanding.item]: library.md#freestanding.item
|
| 460 |
-
[func.bind]: #func.bind
|
| 461 |
-
[func.bind.bind]: #func.bind.bind
|
| 462 |
-
[func.bind.general]: #func.bind.general
|
| 463 |
-
[func.bind.isbind]: #func.bind.isbind
|
| 464 |
-
[func.bind.isplace]: #func.bind.isplace
|
| 465 |
-
[func.bind.partial]: #func.bind.partial
|
| 466 |
-
[func.bind.place]: #func.bind.place
|
| 467 |
-
[func.def]: #func.def
|
| 468 |
-
[func.identity]: #func.identity
|
| 469 |
-
[func.invoke]: #func.invoke
|
| 470 |
-
[func.memfn]: #func.memfn
|
| 471 |
-
[func.not.fn]: #func.not.fn
|
| 472 |
-
[func.require]: #func.require
|
| 473 |
-
[func.search]: #func.search
|
| 474 |
-
[func.search.bm]: #func.search.bm
|
| 475 |
-
[func.search.bmh]: #func.search.bmh
|
| 476 |
-
[func.search.default]: #func.search.default
|
| 477 |
-
[func.search.general]: #func.search.general
|
| 478 |
-
[func.wrap]: #func.wrap
|
| 479 |
-
[func.wrap.badcall]: #func.wrap.badcall
|
| 480 |
-
[func.wrap.func]: #func.wrap.func
|
| 481 |
-
[func.wrap.func.alg]: #func.wrap.func.alg
|
| 482 |
-
[func.wrap.func.cap]: #func.wrap.func.cap
|
| 483 |
-
[func.wrap.func.con]: #func.wrap.func.con
|
| 484 |
-
[func.wrap.func.general]: #func.wrap.func.general
|
| 485 |
-
[func.wrap.func.inv]: #func.wrap.func.inv
|
| 486 |
-
[func.wrap.func.mod]: #func.wrap.func.mod
|
| 487 |
-
[func.wrap.func.nullptr]: #func.wrap.func.nullptr
|
| 488 |
-
[func.wrap.func.targ]: #func.wrap.func.targ
|
| 489 |
-
[func.wrap.general]: #func.wrap.general
|
| 490 |
-
[func.wrap.move]: #func.wrap.move
|
| 491 |
-
[func.wrap.move.class]: #func.wrap.move.class
|
| 492 |
-
[func.wrap.move.ctor]: #func.wrap.move.ctor
|
| 493 |
-
[func.wrap.move.general]: #func.wrap.move.general
|
| 494 |
-
[func.wrap.move.inv]: #func.wrap.move.inv
|
| 495 |
-
[func.wrap.move.util]: #func.wrap.move.util
|
| 496 |
-
[function.objects]: #function.objects
|
| 497 |
-
[function.objects.general]: #function.objects.general
|
| 498 |
-
[functional.syn]: #functional.syn
|
| 499 |
-
[intro.multithread]: basic.md#intro.multithread
|
| 500 |
-
[intro.object]: basic.md#intro.object
|
| 501 |
-
[invalid.argument]: diagnostics.md#invalid.argument
|
| 502 |
-
[istream.formatted]: input.md#istream.formatted
|
| 503 |
-
[iterator.concept.output]: iterators.md#iterator.concept.output
|
| 504 |
-
[lex.string.literal]: lex.md#lex.string.literal
|
| 505 |
-
[logical.operations]: #logical.operations
|
| 506 |
-
[logical.operations.and]: #logical.operations.and
|
| 507 |
-
[logical.operations.general]: #logical.operations.general
|
| 508 |
-
[logical.operations.not]: #logical.operations.not
|
| 509 |
-
[logical.operations.or]: #logical.operations.or
|
| 510 |
-
[meta.rqmts]: meta.md#meta.rqmts
|
| 511 |
-
[meta.trans.other]: meta.md#meta.trans.other
|
| 512 |
-
[namespace.std]: library.md#namespace.std
|
| 513 |
-
[optional]: #optional
|
| 514 |
-
[optional.assign]: #optional.assign
|
| 515 |
-
[optional.assign.copy]: #optional.assign.copy
|
| 516 |
-
[optional.assign.copy.templ]: #optional.assign.copy.templ
|
| 517 |
-
[optional.assign.move]: #optional.assign.move
|
| 518 |
-
[optional.assign.move.templ]: #optional.assign.move.templ
|
| 519 |
-
[optional.bad.access]: #optional.bad.access
|
| 520 |
-
[optional.comp.with.t]: #optional.comp.with.t
|
| 521 |
-
[optional.ctor]: #optional.ctor
|
| 522 |
-
[optional.dtor]: #optional.dtor
|
| 523 |
-
[optional.general]: #optional.general
|
| 524 |
-
[optional.hash]: #optional.hash
|
| 525 |
-
[optional.mod]: #optional.mod
|
| 526 |
-
[optional.monadic]: #optional.monadic
|
| 527 |
-
[optional.nullops]: #optional.nullops
|
| 528 |
-
[optional.nullopt]: #optional.nullopt
|
| 529 |
-
[optional.observe]: #optional.observe
|
| 530 |
-
[optional.optional]: #optional.optional
|
| 531 |
-
[optional.optional.general]: #optional.optional.general
|
| 532 |
-
[optional.relops]: #optional.relops
|
| 533 |
-
[optional.specalg]: #optional.specalg
|
| 534 |
-
[optional.swap]: #optional.swap
|
| 535 |
-
[optional.syn]: #optional.syn
|
| 536 |
-
[ostream.formatted]: input.md#ostream.formatted
|
| 537 |
-
[out.of.range]: diagnostics.md#out.of.range
|
| 538 |
-
[over.match.call]: over.md#over.match.call
|
| 539 |
-
[overflow.error]: diagnostics.md#overflow.error
|
| 540 |
-
[pair.astuple]: #pair.astuple
|
| 541 |
-
[pair.piecewise]: #pair.piecewise
|
| 542 |
-
[pairs]: #pairs
|
| 543 |
-
[pairs.general]: #pairs.general
|
| 544 |
-
[pairs.pair]: #pairs.pair
|
| 545 |
-
[pairs.spec]: #pairs.spec
|
| 546 |
-
[range.cmp]: #range.cmp
|
| 547 |
-
[range.utility.helpers]: ranges.md#range.utility.helpers
|
| 548 |
-
[refwrap]: #refwrap
|
| 549 |
-
[refwrap.access]: #refwrap.access
|
| 550 |
-
[refwrap.assign]: #refwrap.assign
|
| 551 |
-
[refwrap.common.ref]: #refwrap.common.ref
|
| 552 |
-
[refwrap.const]: #refwrap.const
|
| 553 |
-
[refwrap.general]: #refwrap.general
|
| 554 |
-
[refwrap.helpers]: #refwrap.helpers
|
| 555 |
-
[refwrap.invoke]: #refwrap.invoke
|
| 556 |
-
[res.on.exception.handling]: library.md#res.on.exception.handling
|
| 557 |
-
[round.style]: support.md#round.style
|
| 558 |
-
[support.signal]: support.md#support.signal
|
| 559 |
-
[swappable.requirements]: library.md#swappable.requirements
|
| 560 |
-
[temp.param]: temp.md#temp.param
|
| 561 |
-
[temp.type]: temp.md#temp.type
|
| 562 |
-
[template.bitset]: #template.bitset
|
| 563 |
-
[template.bitset.general]: #template.bitset.general
|
| 564 |
-
[term.object.representation]: basic.md#term.object.representation
|
| 565 |
-
[term.object.type]: basic.md#term.object.type
|
| 566 |
-
[term.odr.use]: basic.md#term.odr.use
|
| 567 |
-
[term.perfect.forwarding.call.wrapper]: #term.perfect.forwarding.call.wrapper
|
| 568 |
-
[term.simple.call.wrapper]: #term.simple.call.wrapper
|
| 569 |
-
[term.trivially.copyable.type]: basic.md#term.trivially.copyable.type
|
| 570 |
-
[term.unevaluated.operand]: expr.md#term.unevaluated.operand
|
| 571 |
-
[time.format]: time.md#time.format
|
| 572 |
-
[tuple]: #tuple
|
| 573 |
-
[tuple.apply]: #tuple.apply
|
| 574 |
-
[tuple.assign]: #tuple.assign
|
| 575 |
-
[tuple.cnstr]: #tuple.cnstr
|
| 576 |
-
[tuple.common.ref]: #tuple.common.ref
|
| 577 |
-
[tuple.creation]: #tuple.creation
|
| 578 |
-
[tuple.elem]: #tuple.elem
|
| 579 |
-
[tuple.general]: #tuple.general
|
| 580 |
-
[tuple.helper]: #tuple.helper
|
| 581 |
-
[tuple.like]: #tuple.like
|
| 582 |
-
[tuple.rel]: #tuple.rel
|
| 583 |
-
[tuple.special]: #tuple.special
|
| 584 |
-
[tuple.swap]: #tuple.swap
|
| 585 |
-
[tuple.syn]: #tuple.syn
|
| 586 |
-
[tuple.traits]: #tuple.traits
|
| 587 |
-
[tuple.tuple]: #tuple.tuple
|
| 588 |
-
[type.index]: #type.index
|
| 589 |
-
[type.index.hash]: #type.index.hash
|
| 590 |
-
[type.index.members]: #type.index.members
|
| 591 |
-
[type.index.overview]: #type.index.overview
|
| 592 |
-
[type.index.synopsis]: #type.index.synopsis
|
| 593 |
-
[unord]: containers.md#unord
|
| 594 |
-
[unord.hash]: #unord.hash
|
| 595 |
-
[utilities]: #utilities
|
| 596 |
-
[utilities.general]: #utilities.general
|
| 597 |
-
[utilities.summary]: #utilities.summary
|
| 598 |
-
[utility]: #utility
|
| 599 |
-
[utility.as.const]: #utility.as.const
|
| 600 |
-
[utility.exchange]: #utility.exchange
|
| 601 |
-
[utility.intcmp]: #utility.intcmp
|
| 602 |
-
[utility.swap]: #utility.swap
|
| 603 |
-
[utility.syn]: #utility.syn
|
| 604 |
-
[utility.underlying]: #utility.underlying
|
| 605 |
-
[utility.unreachable]: #utility.unreachable
|
| 606 |
-
[variant]: #variant
|
| 607 |
-
[variant.assign]: #variant.assign
|
| 608 |
-
[variant.bad.access]: #variant.bad.access
|
| 609 |
-
[variant.ctor]: #variant.ctor
|
| 610 |
-
[variant.dtor]: #variant.dtor
|
| 611 |
-
[variant.general]: #variant.general
|
| 612 |
-
[variant.get]: #variant.get
|
| 613 |
-
[variant.hash]: #variant.hash
|
| 614 |
-
[variant.helper]: #variant.helper
|
| 615 |
-
[variant.mod]: #variant.mod
|
| 616 |
-
[variant.monostate]: #variant.monostate
|
| 617 |
-
[variant.monostate.relops]: #variant.monostate.relops
|
| 618 |
-
[variant.relops]: #variant.relops
|
| 619 |
-
[variant.specalg]: #variant.specalg
|
| 620 |
-
[variant.status]: #variant.status
|
| 621 |
-
[variant.swap]: #variant.swap
|
| 622 |
-
[variant.syn]: #variant.syn
|
| 623 |
-
[variant.variant]: #variant.variant
|
| 624 |
-
[variant.variant.general]: #variant.variant.general
|
| 625 |
-
[variant.visit]: #variant.visit
|
| 626 |
-
|
| 627 |
-
[^1]: Such a type is a function pointer or a class type which has a
|
| 628 |
-
member `operator()` or a class type which has a conversion to a
|
| 629 |
-
pointer to function.
|
| 630 |
-
|
| 631 |
-
[^2]: Windows® is a registered trademark of Microsoft Corporation. This
|
| 632 |
-
information is given for the convenience of users of this document
|
| 633 |
-
and does not constitute an endorsement by ISO or IEC of this
|
| 634 |
-
product.
|
|
|
|
| 28 |
template<class T>
|
| 29 |
constexpr int bit_width(T x) noexcept;
|
| 30 |
|
| 31 |
// [bit.rotate], rotating
|
| 32 |
template<class T>
|
| 33 |
+
constexpr T rotl(T x, int s) noexcept;
|
| 34 |
template<class T>
|
| 35 |
+
constexpr T rotr(T x, int s) noexcept;
|
| 36 |
|
| 37 |
// [bit.count], counting
|
| 38 |
template<class T>
|
| 39 |
constexpr int countl_zero(T x) noexcept;
|
| 40 |
template<class T>
|
|
|
|
| 66 |
|
| 67 |
- `sizeof(To) == sizeof(From)` is `true`;
|
| 68 |
- `is_trivially_copyable_v<To>` is `true`; and
|
| 69 |
- `is_trivially_copyable_v<From>` is `true`.
|
| 70 |
|
| 71 |
+
*Mandates:* Neither `To` nor `From` are consteval-only
|
| 72 |
+
types [[basic.types.general]].
|
| 73 |
+
|
| 74 |
+
`To`, `From`, and the types of all subobjects of `To` and `From` are
|
| 75 |
+
types `T` such that:
|
| 76 |
+
|
| 77 |
+
- `is_union_v<T>` is `false`;
|
| 78 |
+
- `is_pointer_v<T>` is `false`;
|
| 79 |
+
- `is_member_pointer_v<T>` is `false`;
|
| 80 |
+
- `is_volatile_v<T>` is `false`; and
|
| 81 |
+
- `T` has no non-static data members of reference type.
|
| 82 |
+
|
| 83 |
*Returns:* An object of type `To`. Implicitly creates objects nested
|
| 84 |
within the result [[intro.object]]. Each bit of the value representation
|
| 85 |
of the result is equal to the corresponding bit in the object
|
| 86 |
representation of `from`. Padding bits of the result are unspecified.
|
| 87 |
For the result and each object created within it, if there is no value
|
| 88 |
of the object’s type corresponding to the value representation produced,
|
| 89 |
the behavior is undefined. If there are multiple such values, which
|
| 90 |
value is produced is unspecified. A bit in the value representation of
|
| 91 |
the result is indeterminate if it does not correspond to a bit in the
|
| 92 |
+
value representation of `from` or corresponds to a bit for which the
|
| 93 |
+
smallest enclosing object is not within its lifetime or has an
|
| 94 |
+
indeterminate value [[basic.indet]]. A bit in the value representation
|
| 95 |
+
of the result is erroneous if it corresponds to a bit for which the
|
| 96 |
+
smallest enclosing object has an erroneous value. For each bit b in the
|
| 97 |
+
value representation of the result that is indeterminate or erroneous,
|
| 98 |
+
let u be the smallest object containing that bit enclosing b:
|
| 99 |
|
| 100 |
+
- If u is of unsigned ordinary character type or `std::byte` type, u has
|
| 101 |
+
an indeterminate value if any of the bits in its value representation
|
| 102 |
+
are indeterminate, or otherwise has an erroneous value.
|
| 103 |
+
- Otherwise, if b is indeterminate, the behavior is undefined.
|
| 104 |
+
- Otherwise, the behavior is erroneous, and the result is as specified
|
| 105 |
+
above.
|
| 106 |
|
| 107 |
+
The result does not otherwise contain any indeterminate or erroneous
|
| 108 |
+
values.
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
### `byteswap` <a id="bit.byteswap">[[bit.byteswap]]</a>
|
| 111 |
|
| 112 |
``` cpp
|
| 113 |
template<class T>
|
|
|
|
| 180 |
In the following descriptions, let `N` denote
|
| 181 |
`numeric_limits<T>::digits`.
|
| 182 |
|
| 183 |
``` cpp
|
| 184 |
template<class T>
|
| 185 |
+
constexpr T rotl(T x, int s) noexcept;
|
| 186 |
```
|
| 187 |
|
| 188 |
*Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
|
| 189 |
|
| 190 |
Let `r` be `s % N`.
|
|
|
|
| 192 |
*Returns:* If `r` is `0`, `x`; if `r` is positive,
|
| 193 |
`(x << r) | (x >> (N - r))`; if `r` is negative, `rotr(x, -r)`.
|
| 194 |
|
| 195 |
``` cpp
|
| 196 |
template<class T>
|
| 197 |
+
constexpr T rotr(T x, int s) noexcept;
|
| 198 |
```
|
| 199 |
|
| 200 |
*Constraints:* `T` is an unsigned integer type [[basic.fundamental]].
|
| 201 |
|
| 202 |
Let `r` be `s % N`.
|
|
|
|
| 292 |
big-endian, `endian::native` is equal to `endian::big`. If all scalar
|
| 293 |
types are little-endian, `endian::native` is equal to `endian::little`.
|
| 294 |
Otherwise, `endian::native` is not equal to either `endian::big` or
|
| 295 |
`endian::little`.
|
| 296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|