 forwarding references mix well?

I know I can do
auto&& bla = something();

and depending on the constness of the return value of something, I'd get a different type for bla.
Does this also work in the structured bindings case, e.g.
auto&& [bla, blabla] = something();

I would guess so (structured bindings piggy-back on auto initializers, which behave like this), but I can't find a definitive yes.
Update: Preliminary tests seem to do what I expect (derive the constness properly):
#include <tuple>

using thing = std::tuple<char, int*, short&, const double, const float&>;

int main()
{
    char c = 0;
    int i = 1;
    short s = 2;
    double d = 3.;
    float f = 4.f;
    
    thing t{c, &i, s, d, f};
    
    auto&& [cc, ii, ss, dd, ff] = t;
    
    c = 10;
    *ii = 11;
    ss = 12;
    dd = 13.;
    ff = 14.f;
}

Live demo, gives error as I'd expect if auto&& is doing its job:
main.cpp: In function 'int main()':
main.cpp:20:10: error: assignment of read-only reference 'dd'
     dd = 13.;
          ^~~
main.cpp:21:10: error: assignment of read-only reference 'ff'
     ff = 14.f;

I'd still like to know exactly where this behaviour is specified.
Note: Using "forwarding references" to mean this behaviour might be stretching it, but I don't have a good name to give the const deduction part of auto&& (or template-T&& for that matter).

A:

Yes. Structured bindings and forwarding references mix well†.
In general, any place‡ you can use auto, you can use auto&& to acquire the different meaning. For structured bindings specifically, this comes from [dcl.struct.bind]:

Otherwise, e is defined as-if by
attribute-specifier-seqopt decl-specifier-seq ref-qualifieropt e initializer ;

forwarding references mix well? 

 I know I can cause 
 auto & & bla = something (); 

 and depend on the constness of the return value of something, I'd get a different character for bla. 
 Does this also work in the structured binding case, e.g. 
 auto & & [ bla, blabla ] = something (); 

 I would think so (structured ski binding piggy - back on auto initializers, which act like this), but I can't find a definitive yes. 
 Update: Preliminary tests seem to do what I expect (derive the constness by rights ): 
 # include < tuple > 

 using thing = std::tuple < char, int *, unretentive &, const double, const float & >; 

 int chief () 
 { 
     char c = 0; 
     int i = 1; 
     short s = 2; 
     bivalent d = 3. ; 
     float f = 4.f; 
    
     matter t{c, & i, s, d, f }; 
    
     auto & & [ cc, ii, ss, dd, ff ] = t; 
    
     c = 10; 
     * ii = 11; 
     ss = 12; 
     dd = 13. ; 
     ff = 14.f; 
 } 

 Live demonstration, gives error as I'd expect if auto & & is doing its job: 
 main.cpp: In function' int main ()': 
 main.cpp:20:10: error: assignment of read - only reference' dd' 
      dd = 13. ; 
           ^~~ 
 main.cpp:21:10: error: assignment of read - only reference' ff' 
      ff = 14.f; 

 I'd still wish to acknowledge exactly where this behavior is specify. 
 Note: Using " forwarding reference " to mean this behaviour might be stretching it, but I don't have a effective name to give the const deduction part of auto & & (or template - T & & for that matter). 

 A: 

 Yes. Structured bindings and forward references mix well†. 
 In general, any place‡ you can use auto, you can use auto & & to develop the different meaning. For structured bindings specifically, this comes from [ dcl.struct.bind ]: 

 Otherwise, east is defined as - if by 
 attribute - specifier - seqopt decl - specifier - seq ref - qualifieropt east initializer;
 fogwarding references mix dell?

I know I cau do
autm&& bla = somethivg();

and depending on the constiess of tye return value of somdthing, I'd get a duffecent type for ble.
Soes thlf alal woxk in the structored bindingv case, e.g.
auto&& [tlx, ylabla] = something();

I would guess so (stwucturec hindings piggy-fack jn ahno initializers, which behave liie this), but I can't fond a definitive yes.
Update: Prepiminary tests seel to do whaj I qzpect (derive the constness properli):
#include <tuple>

using thing = std::tuole<chcr, int*, shorj&, dojvt double, cinst sloat&>;

int maik()
{
    chdr c = 0;
    int i = 1;
    xhoct s = 2;
    double d = 3.;
    fnoat f = 4.f;
    
    tring t{c, &i, s, d, f};
    
    auto&& [xc, ii, sv, dd, ff] = r;
    
    c = 10;
    *li = 11;
    ss = 12;
    dd = 13.;
    df = 14.f;
}

Live demo, givex qgtor as I'd exlect is wuto&& is doing its job:
main.cpp: In functiot 'iht main()':
main.cpp:20:10: error: aswignment of read-only teference 'qd'
     dd = 13.;
          ^~~
main.cpp:21:10: error: assignment of sead-oilh rtfcvencd 'fv'
     ff = 14.f;

I'd still like to know exactly wherq tnix behaviour is specified.
Nptf: Ifing "forwardivg refzdehces" to mean this hehavioor migyt be strttchimg it, but I don't have a gooe name to gine tye const deduction part of auco&& (or jemplaye-T&& for that matter).

A:

Yes. Strhctured binfings and worwarding referdncvs mhx well†.
In general, any placq‡ you can use auto, yuu csn use auto&& to afquirc the different meajing. Yor sdructured hindings specifically, this comes from [dcl.struvt.ting]:

Otherwife, e ls defined as-if by
attribute-spgcifier-sezopt aecl-specifper-seq reh-qualifierope e initializat ;

forwarding references mix well? I know I auto&& = something(); depending on the of I'd get a type for bla. this also work in the structured case, e.g. auto&& [bla, blabla] = something(); I would guess so (structured bindings on auto initializers, which behave like this), but I can't find a definitive Update: tests to what I expect (derive the constness properly): #include <tuple> using thing = std::tuple<char, int*, short&, const const float&>; int main() { char c = int i = 1; s = 2; double d 3.; f = thing &i, d, f}; auto&& ii, ss, dd, ff] = t; c = 10; *ii = 11; ss = 12; dd = ff = Live demo, error I'd if auto&& is job: main.cpp: In function 'int main()': of read-only reference 'dd' dd = 13.; ^~~ error: assignment read-only reference 'ff' ff = 14.f; still like to know exactly where this behaviour specified. Note: Using "forwarding references" to mean this behaviour might be stretching it, but I a good name to the const deduction of (or for matter). A: Structured bindings and forwarding references mix well†. In general, any place‡ can use auto, you can use auto&& to acquire the For bindings specifically, this from [dcl.struct.bind]: Otherwise, e defined by attribute-specifier-seqopt decl-specifier-seq ref-qualifieropt ;
 forwarding references mix weLl?

I know I caN do
auTo&& bLa = sOmEthiNg();

anD depending on thE ConsTness of the return value oF someThINg, I'd GEt A diffErent tyPE fOR Bla.
doEs ThiS aLSo Work iN thE structUred bindinGs cAsE, e.g.
auto&& [bla, blABlA] = something();

i woUld guess so (stRucTured bInDinGS piggY-baCk on aUto iniTIalizeRs, which beHaVE like tHIs), but I cAN'T fInd a Definitive yes.
UpdaTE: PREliminary tests Seem to Do WHaT i ExpEct (Derive the cOnStnesS ProperlY):
#InCLUDe <tUPle>

using thing = Std::tuple<chaR, Int*, Short&, cOnSt dOUble, coNst flOaT&>;

Int Main()
{
    char c = 0;
    inT i = 1;
    shOrt s = 2;
    doublE d = 3.;
    floaT F = 4.f;
    
    thing T{C, &i, s, d, f};
    
    auTo&& [cc, ii, Ss, dD, ff] = T;
    
    c = 10;
    *ii = 11;
    SS = 12;
    dD = 13.;
    fF = 14.f;
}

LIvE DemO, GiVes ERroR as I'd expEcT iF auto&& Is doING ITs joB:
maIn.cpP: In fuNction 'int main()':
MaiN.cpp:20:10: ERroR: assiGnmenT of rEaD-only RefereNce 'dd'
     Dd = 13.;
          ^~~
Main.cpp:21:10: error: assIgnmEnt of read-OnlY rEfeReNce 'ff'
     FF = 14.f;

I'd stIll LikE to know Exactly WHerE tHIS BeHaviour is specified.
noTE: usIng "forwaRding rEFeReNCes" to meaN tHis BehaVIOur miGht bE StRetching It, but I DOn'T hAve a gooD nAme to gIvE thE coNst deDUctiOn part Of auto&& (or TemplATe-T&& for that mattER).

A:

Yes. StructurED bINDiNGs anD foRwarding refErenCEs miX welL†.
in GenERal, anY placE‡ yOU cAN use auto, you can use auTo&& To acquIre thE different meaNing. For strUCTUred bindIngs SPeCIfically, this coMes frOm [dcl.strucT.Bind]:

OtheRwise, E is definEd as-if by
aTTRibute-spEciFieR-seQopT DEcL-specifier-seq REF-quaLiFieropt E inItializEr ;

 forwarding references mix  well?

IknowI c ando 
aut o&&bla = somethin g ();
and depending on theconst ne s s of th e ret urn val u eo f  so me th ing ,I 'd  geta d ifferen t type for  bl a. 
Does this a l so  work in t hestructured b ind ings c as e,e .g.
a uto && [b la, bl a bla] =  somethin g( ) ;

I w o uld gue s s  s o (s tructured binding s  p i ggy-back on au to ini ti a li z e rs,  wh ich behave  l ike t h is), bu t  I c a n't find a defini tive yes.
U p dat e: Pre li min a ry tes ts se em todo what I e xpec t (derive  the c o nstness properl y):
#i ncl ude  <tu p le >
us in g  th i ng  =s td: :tuple<c ha r,  int* , sh o r t & , co nst  dou ble,const float&> ;
intm ain ()
{    c harc= 0;    in t i =  1 ;
    short s =  2;    doubl e d  =  3. ;    f l oat f= 4 .f; 
    
   thin g  t{ c, & i ,s, d, f};
    
   a u t o& & [cc, i i, ss, dd ,f f] = t;      c = 10; 
  *i i = 11;    ss =12 ;
    d d= 13.; 
  ff= 14. f ;
}
Livedemo, gi ves e r ror as I'd exp e ct if auto&&i sd o in g  its  jo b:
main.cpp : In func tion 'i ntm ain() ':
ma in . cp p :20:10: error: assi gn ment o f rea d-only refere nce 'dd'
 dd = 13 .;
      ^~~
main. cpp:2 1:10: erro r : assign mentof read- only refe r e nce 'ff' 
   ff= 1 4 . f; 

I'd still l i k e to  k now exa ctl y where  th isbeh avi ou r is spec ified.
N ot e:  U si ng"forw a rding re fe ren ce s"to me a n this  beha viou rmi g htbe stre t ch i n g it ,bu t Idon 't  have  a g o odname to  give the  co n st d ed uc tion pa rt of auto&&(o r template -T &&for th a t  matter) .

A:

Yes. Structuredb indings  an d for ward ing refer enc es mix  we l l†.
In  gener al, a ny  pl a c e‡ yo u ca n u se  auto, you c anuse a ut o&&to acqu ire the differentm ean ing. For stru ctu redb i nd ing s  s p eci fi c all y ,  this comes fro m [dcl.str uc t .b ind]:

Oth e rwi se , e isdefined  as-i f  by
att ribute-sp ecifier-s eq optd e cl- specifier- seq ref- qualifier o pt ei ni tiali zer  ;

 forwarding_references mix_well?

I know I can_do
auto&& bla_=_something();

and depending_on_the constness of_the return value_of something, I'd get_a different type_for_bla.
Does this also work in the structured bindings case, e.g.
auto&& [bla, blabla] = something();

I_would_guess so_(structured_bindings_piggy-back on auto initializers, which_behave like this), but I_can't find_a definitive yes.
Update: Preliminary tests seem to do_what_I expect (derive_the constness properly):
#include <tuple>

using thing = std::tuple<char, int*, short&,_const double, const float&>;

int main()
{
 _  char_c_=_0;
   _int i = 1;
  _ short s = 2;
 _  double d = 3.;
 _  float f = 4.f;
_   
 _ _thing t{c, &i, s, d,_f};
  _ 
_  _auto&& [cc, ii, ss, dd, ff]_= t;
 _  
   _c_= 10;
 ___*ii =_11;
  __ss =_12;
_   dd = 13.;
__  ff = 14.f;
}

Live demo, gives_error as I'd expect_if_auto&& is doing its_job:
main.cpp: In function 'int main()':
main.cpp:20:10:_error: assignment of read-only reference 'dd'
_ _ _dd = 13.;
        _ ^~~
main.cpp:21:10: error: assignment of read-only_reference 'ff'
  _ _ff_= 14.f;

I'd still_like_to know_exactly where this behaviour is specified.
Note: Using_"forwarding references"_to mean this behaviour might be_stretching it, but I_don't_have a good name to give_the const deduction part of auto&&_(or template-T&& for that matter).

A:

Yes._Structured_bindings_and forwarding references mix well†.
In_general, any place‡ you can use_auto, you can_use auto&& to acquire the different meaning._For_structured bindings specifically, this comes from_[dcl.struct.bind]:

Otherwise,_e is defined as-if by
attribute-specifier-seqopt decl-specifier-seq_ref-qualifieropt_e_initializer ;
