delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
From: | "Thomas Tutone" <Thomas8675309NO_SPAM AT yahoo DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
References: | <baec0bf0 DOT 0401150203 DOT 3131cb36 AT posting DOT google DOT com> <7b68d58f DOT 0401150929 DOT c3117c3 AT posting DOT google DOT com> <bu7dmc$eofha$1 AT ID-55127 DOT news DOT uni-berlin DOT de> |
Subject: | Re: Does DJGPP support binary format for integer constants? |
Lines: | 19 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 6.00.2800.1158 |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2800.1165 |
Message-ID: | <bq3Ob.24421$VS4.748215@bgtnsc04-news.ops.worldnet.att.net> |
Date: | Sat, 17 Jan 2004 05:07:19 GMT |
NNTP-Posting-Host: | 12.77.124.101 |
X-Complaints-To: | abuse AT worldnet DOT att DOT net |
X-Trace: | bgtnsc04-news.ops.worldnet.att.net 1074316039 12.77.124.101 (Sat, 17 Jan 2004 05:07:19 GMT) |
NNTP-Posting-Date: | Sat, 17 Jan 2004 05:07:19 GMT |
Organization: | AT&T Worldnet |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
"Gerald K. Dobiasovsky" wrote: > I assume he wants to knmow if there's a way to have > constants in binary format instead of decimal or octal > or hex. If so, I don't think there's a way to to do this directly, but you can fake it using a std::bitset. Josuttis has an example on page 462 of The C++ Standard Library. The problem is that this method does not provide a compile-time constant directly. Instead, you can define a constant at namespace scope (or a static constant inside a function) equal to a bitset().to_ulong(), so it only gets calculated once. Not perfect, but works for many purposes. Best regards, Tom
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |