Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #41120
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Ian Collins <ian-news@hotmail.com> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: String integer id |
| Date | Tue, 23 Feb 2016 09:13:31 +1300 |
| Lines | 22 |
| Message-ID | <dj18fbFj7j6U10@mid.individual.net> (permalink) |
| References | <224a55e1-bcba-4063-915d-02f0b53dd294@googlegroups.com> <gmnmcbph3ui9hga32drdehpdfior35d6nr@4ax.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net YOlKqAi2Dt2Rkl8fVF7SfAQIeVuc1PyMvkuPUQz9EaTPMvlvMC |
| Cancel-Lock | sha1:zC9yoymKvLPRpk4WPMmLt5WMNOs= |
| User-Agent | Mozilla/5.0 (X11; SunOS i86pc; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
| In-Reply-To | <gmnmcbph3ui9hga32drdehpdfior35d6nr@4ax.com> |
| Xref | csiph.com comp.lang.c++:41120 |
Show key headers only | View raw
Barry Schwarz wrote: > On Mon, 22 Feb 2016 06:59:14 -0800 (PST), > malcolm.mclean5@btinternet.com wrote: > >> I want a flyweight class that is a "string id". >> That is to say, it consists of a 64 bit number which is also a string of up to seven >> characters, used for passing about human-readable ids that the machine can >> process as integers. >> >> However how do I write it so that it's easy to make it a constexpr, whilst still being >> convenient to call. (The ids will mostly be known at compile time, only rarely will >> you have a situation when the user enters a string and it ends up being turned >> into a dynamic id). >> Particularly I would like to be able to switch on the id and have human-readable names >> in the case conditions. > > For values known at compile time, #define should do what you want. This is comp.lang.c++, cont comp.lang.c! -- Ian Collins
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
String integer id malcolm.mclean5@btinternet.com - 2016-02-22 06:59 -0800
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-22 17:30 +0100
Re: String integer id malcolm.mclean5@btinternet.com - 2016-02-22 09:04 -0800
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-22 19:03 +0100
Re: String integer id malcolm.mclean5@btinternet.com - 2016-02-22 13:22 -0800
Re: String integer id Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-02-22 23:02 +0000
Re: String integer id Öö Tiib <ootiib@hot.ee> - 2016-02-22 15:16 -0800
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-22 19:54 -0500
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-23 02:26 +0100
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-22 20:35 -0500
Re: String integer id legalize+jeeves@mail.xmission.com (Richard) - 2016-02-23 02:31 +0000
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-22 21:42 -0500
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-23 04:59 +0100
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-23 08:32 -0500
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-23 03:34 +0100
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-22 21:38 -0500
Re: String integer id Google <google@google.com> - 2016-02-22 19:36 -0800
Re: String integer id David Brown <david.brown@hesbynett.no> - 2016-02-23 09:25 +0100
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-23 08:33 -0500
Re: String integer id David Brown <david.brown@hesbynett.no> - 2016-02-23 15:43 +0100
Re: String integer id Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-23 11:21 -0500
Re: String integer id woodbrian77@gmail.com - 2016-02-22 20:48 -0800
Re: String integer id David Brown <david.brown@hesbynett.no> - 2016-02-23 09:16 +0100
Re: String integer id Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-23 18:23 +0200
Re: String integer id David Brown <david.brown@hesbynett.no> - 2016-02-23 22:29 +0100
Re: String integer id Barry Schwarz <schwarzb@dqel.com> - 2016-02-22 11:41 -0800
Re: String integer id Ian Collins <ian-news@hotmail.com> - 2016-02-23 09:13 +1300
Re: String integer id Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-23 00:32 +0200
Re: String integer id legalize+jeeves@mail.xmission.com (Richard) - 2016-02-22 22:39 +0000
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-23 00:46 +0100
Re: String integer id Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-23 10:01 +0200
Re: String integer id "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-23 19:15 +0100
Re: String integer id Paavo Helde <myfirstname@osa.pri.ee> - 2016-02-23 21:40 +0200
Re: String integer id Juha Nieminen <nospam@thanks.invalid> - 2016-02-23 09:18 +0000
Re: String integer id malcolm.mclean5@btinternet.com - 2016-02-23 03:15 -0800
csiph-web