@@ -196,7 +196,7 @@ using virtual_types = boost::mp11::mp_transform<
196196
197197template <typename T, class Policy >
198198struct parameter_traits {
199- static auto peek (const T& arg ) {
199+ static auto peek (const T&) {
200200 return nullptr ;
201201 }
202202
@@ -346,15 +346,15 @@ class virtual_ptr_impl {
346346 virtual_ptr_impl () = default ;
347347
348348 explicit virtual_ptr_impl (std::nullptr_t )
349- : obj( nullptr ), vp(box_vptr<use_indirect_vptrs>(null_vptr)) {
349+ : vp(box_vptr<use_indirect_vptrs>(null_vptr)), obj( nullptr ) {
350350 }
351351
352352 template <
353353 class Other ,
354354 typename = std::enable_if_t <std::is_constructible_v<Class*, Other*>>>
355355 virtual_ptr_impl (Other& other)
356- : obj(& other),
357- vp (box_vptr<use_indirect_vptrs>(Policy::dynamic_vptr( other)) ) {
356+ : vp(box_vptr<use_indirect_vptrs>(Policy::dynamic_vptr( other)) ),
357+ obj (& other) {
358358 }
359359
360360 template <
@@ -363,8 +363,8 @@ class virtual_ptr_impl {
363363 Class*,
364364 decltype (std::declval<virtual_ptr<Other, Policy>>().get())>>>
365365 virtual_ptr_impl(Other* other)
366- : obj( other),
367- vp(box_vptr<use_indirect_vptrs>(Policy::dynamic_vptr(* other)) ) {
366+ : vp(box_vptr<use_indirect_vptrs>(Policy::dynamic_vptr(* other)) ),
367+ obj( other) {
368368 }
369369
370370 template <
@@ -373,7 +373,7 @@ class virtual_ptr_impl {
373373 Class*,
374374 decltype (std::declval<virtual_ptr<Other, Policy>>().get())>>>
375375 virtual_ptr_impl(const virtual_ptr<Other, Policy>& other)
376- : obj (other.get()), vp (other.vp ) {
376+ : vp (other.vp), obj (other.get() ) {
377377 }
378378
379379 template <
@@ -382,7 +382,7 @@ class virtual_ptr_impl {
382382 Class*,
383383 decltype (std::declval<virtual_ptr<Other, Policy>>().get())>>>
384384 virtual_ptr_impl(virtual_ptr<Other, Policy>& other)
385- : obj (other.get()), vp (other.vp ) {
385+ : vp (other.vp), obj (other.get() ) {
386386 // Why is this needed? Consider this conversion conversion from
387387 // smart to dumb pointer:
388388 // virtual_ptr<std::shared_ptr<const Node>> p = ...;
@@ -397,7 +397,7 @@ class virtual_ptr_impl {
397397 class Other ,
398398 typename = std::enable_if_t <std::is_constructible_v<Class*, Other*>>>
399399 virtual_ptr_impl (Other& other, const vptr_type& vp)
400- : obj(&other), vp(box_vptr<use_indirect_vptrs>(vp)) {
400+ : vp(box_vptr<use_indirect_vptrs>(vp)), obj(&other ) {
401401 }
402402
403403 template <
@@ -515,7 +515,7 @@ class virtual_ptr_impl<
515515 }
516516
517517 explicit virtual_ptr_impl (std::nullptr_t )
518- : obj( nullptr ), vp(box_vptr<use_indirect_vptrs>(null_vptr)) {
518+ : vp(box_vptr<use_indirect_vptrs>(null_vptr)), obj( nullptr ) {
519519 }
520520
521521 virtual_ptr_impl (const virtual_ptr_impl& other) = default ;
@@ -526,8 +526,9 @@ class virtual_ptr_impl<
526526 same_smart_ptr<Class, Other, Policy> &&
527527 std::is_constructible_v<Class, const Other&>>>
528528 virtual_ptr_impl (const Other& other)
529- : obj(other), vp(box_vptr<use_indirect_vptrs>(
530- other ? Policy::dynamic_vptr(*other) : null_vptr)) {
529+ : vp(box_vptr<use_indirect_vptrs>(
530+ other ? Policy::dynamic_vptr(*other) : null_vptr)),
531+ obj (other) {
531532 }
532533
533534 template <
@@ -536,8 +537,9 @@ class virtual_ptr_impl<
536537 same_smart_ptr<Class, Other, Policy> &&
537538 std::is_constructible_v<Class, Other&>>>
538539 virtual_ptr_impl (Other& other)
539- : obj(other), vp(box_vptr<use_indirect_vptrs>(
540- other ? Policy::dynamic_vptr(*other) : null_vptr)) {
540+ : vp(box_vptr<use_indirect_vptrs>(
541+ other ? Policy::dynamic_vptr(*other) : null_vptr)),
542+ obj(other) {
541543 }
542544
543545 template <
@@ -546,9 +548,9 @@ class virtual_ptr_impl<
546548 same_smart_ptr<Class, Other, Policy> &&
547549 std::is_constructible_v<Class, Other&&>>>
548550 virtual_ptr_impl (Other&& other)
549- : obj(std::move(other)),
550- vp (box_vptr<use_indirect_vptrs>(
551- other ? Policy::dynamic_vptr(* other) : null_vptr )) {
551+ : vp(box_vptr<use_indirect_vptrs>(
552+ other ? Policy::dynamic_vptr(*other) : null_vptr)),
553+ obj(std::move( other)) {
552554 }
553555
554556 template <
@@ -557,7 +559,7 @@ class virtual_ptr_impl<
557559 same_smart_ptr<Class, Other, Policy> &&
558560 std::is_constructible_v<Class, const Other&>>>
559561 virtual_ptr_impl (const virtual_ptr<Other, Policy>& other)
560- : obj (other.obj ), vp (other.vp ) {
562+ : vp (other.vp ), obj (other.obj ) {
561563 }
562564
563565 template <
@@ -566,11 +568,11 @@ class virtual_ptr_impl<
566568 same_smart_ptr<Class, Other, Policy> &&
567569 std::is_constructible_v<Class, Other&>>>
568570 virtual_ptr_impl (virtual_ptr<Other, Policy>& other)
569- : obj (other.obj ), vp (other.vp ) {
571+ : vp (other.vp ), obj (other.obj ) {
570572 }
571573
572574 virtual_ptr_impl (virtual_ptr_impl&& other)
573- : obj(std::move(other.obj)), vp(other.vp ) {
575+ : vp(other.vp), obj(std::move(other.obj)) {
574576 other.vp = box_vptr<use_indirect_vptrs>(null_vptr);
575577 }
576578
@@ -580,7 +582,7 @@ class virtual_ptr_impl<
580582 same_smart_ptr<Class, Other, Policy> &&
581583 std::is_constructible_v<Class, Other&&>>>
582584 virtual_ptr_impl (virtual_ptr<Other, Policy>&& other)
583- : obj(std::move(other.obj)), vp(other.vp ) {
585+ : vp(other.vp), obj(std::move(other.obj)) {
584586 other.vp = box_vptr<use_indirect_vptrs>(null_vptr);
585587 }
586588
@@ -665,7 +667,7 @@ class virtual_ptr_impl<
665667
666668 template <typename Arg>
667669 virtual_ptr_impl (Arg&& obj, decltype (vp) other_vp)
668- : obj(std::forward<Arg>(obj)), vp(other_vp ) {
670+ : vp(other_vp), obj(std::forward<Arg>(obj)) {
669671 }
670672
671673 template <class Other >
0 commit comments