|
Boost : |
Subject: Re: [boost] [Hana] Announcing Hana's formal review next week (June 10th)
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2015-06-12 14:17:19
Paul Fultz II <pfultz2 <at> yahoo.com> writes:
>
> > > I am probably missing something, but can't you check that the first
> > > element of every pair going into the map is a compile-time constant.
> > « []
> >
> > No, because not only compile-time constants can be used as the keys of a
> > Map.
>
> Yes, but as a simple smoke screen, you could always check that the key
> compared against itself will return an `IntregralConstant`. That should
> always be required to be valid, and it would help catch errors earlier on.
That's an interesting idea, and I just implemented this for both Set and Map.
For illustration, here's what happens when
1. creating a Map with something else than pairs:
auto m = make_map(1);
error: static_assert failed
¡
¹èéµ
ñ5
Àø¡Á
¥É̸¸¸¤ÉÅÕ¥ÉÌ
±°Ñ¡Á
¥ÉÌѼAɽÕÑÌ(ÍÑ
Ñ¥}
ÍÍÉС¡
¹èé
±°¡
É}Á
¥É̤°(xùùùùùùùùùùùùùùùùùùùø(((ȸÉ
Ñ¥¹5
ÀÝ¥Ñ ¹½¸µ
½µÁ
É
±åÌè((ÍÑÉÕн¼ìôì(
ÕѼ´ôµ
}µ
À¡µ
}Á
¥È¡½½íô°½¹¤¤ì((ÉɽÈèÍÑ
Ñ¥}
ÍÍÉÐ
¥±(¡
¹èéµ
ñ5
Àø¡Á
¥É̸¸¸¤ÉÅÕ¥ÉÌ
±°Ñ¡åÌѼ
½µÁ
É
±(ÍÑ
Ñ¥}
ÍÍÉС¡
¹èé
±°¡
É}
½µÁ
É
±¤°(xùùùùùùùùùùùùùùùùùùùùùùùùø(((̸É
Ñ¥¹5
ÀÝ¥Ñ åÌÑ¡
Ð
ɽ٥½Õͱ乽Ð
½µÁ
É
±
нµÁ¥±µÑ¥µ((
ÕѼ´ôµ
}µ
À¡µ
}Á
¥È Ä°½¹¤¤ì((ÉɽÈèÍÑ
Ñ¥}
ÍÍÉÐ
¥±(¡
¹èéµ
ñ5
Àø¡Á
¥É̸¸¸¤ÉÅÕ¥ÉÌ
±°Ñ¡åÌѼ
½µÁ
É
±(
нµÆR×FÖR ¢7FF5ö76W'B棦ÆÂ&Uö6ö×ÆU÷FÖUô6ö×&&ÆRÀ¢âçççççççççççççççççççççççççççççççççççççà ¥6ÖÆ"W'&÷"ÖW76vW2&RF&÷vâ'6WBvVâW6æræöâÔ6ö×&&ÆR÷"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk