http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* Difference between Windows and Linux GCC compiler - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/f432fafbea7d806a?hl=en
* Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? - 4 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/40783f7f814400c9?hl=en
* True Religion Jeans - True Religion Mens Jeans - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/f04e39a24e30b85e?hl=en
* static inline functions - possible? - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/0386357e12bd0064?hl=en
* SSO - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/77f7c1c9190e45a7?hl=en
* negative powers of two - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.c++/t/50db9695edc9e79f?hl=en
* New release of the Dynace OO extension to C - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/ee8689156295093c?hl=en
* Comprehensive Test Banks and solution manuals - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b1b9562f844f74cd?hl=en
* Preprocessor - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/ced42e524144e221?hl=en
* strcpy vs memcpy - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/71a5945deead500c?hl=en
* How to return a reference, when I really need it - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/2062f1cc85db88f2?hl=en
* ¤♡¤Whoelsale HTC mobile phones,Google-G2,P800,P3470,S1,S600,S900,X9500,TyTN-
II,X7500 Www.toptradea.com *_* Our policy: order 1-3pce brand mobile with a
free polo Tshirt, order more than 5 pcs brand mobiles with a free nike sneaker
(time limited) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/dec137801b3365f0?hl=en
* question on vector<char>::difference_type - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/0887bb3c0dd6545e?hl=en
==============================================================================
TOPIC: Difference between Windows and Linux GCC compiler
http://groups.google.com/group/comp.lang.c++/t/f432fafbea7d806a?hl=en
==============================================================================
== 1 of 2 ==
Date: Fri, Jul 31 2009 3:21 am
From: SaticCaster
See "1. The first step. 64-bit mode can be different. Let's sort it
out" in article
Seven Steps of Migrating a Program to a 64-bit System
http://www.viva64.com/art-1-2-850243650.html
== 2 of 2 ==
Date: Fri, Jul 31 2009 3:54 am
From: "Balog Pal"
> Well having that said, I had a quick look in my code and there are some
> very minor differences (not sure if they are actually necessary).
There is a good faq on the net listing the differences of winsock and bsd
sockets, must-read for anyone writing such code.
==============================================================================
TOPIC: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3?
http://groups.google.com/group/comp.lang.c++/t/40783f7f814400c9?hl=en
==============================================================================
== 1 of 4 ==
Date: Fri, Jul 31 2009 3:27 am
From: Georg Bauhaus
Paul Rubin schrieb:
> Isaac Gouy <igouy2@yahoo.com> writes:
>> His measurements suggest about 1.7s of a 6s difference might be
>> accounted for by slow Text_IO in programs that write 245MB.
>>
>> The benchmarks game measurements are made with stdout redirected to /
>> dev/null - we don't know if that was also the case for the
>> measurements reported by Georg Bauhaus.
>
> If Text_IO is slow, it could be that it burns a lot of cpu doing
> format conversions, or maybe it uses less buffering than stdio and
> therefore does more system calls. Redirecting to /dev/null wouldn't
> make any difference to either of those.
I measured with redirection > /dev/null for both programs
and got the (expected) significant difference.
Text_IO is slow by design (being designed around page
control, column control, formatting, etc. It's
not just moving chunks of char objects.)
== 2 of 4 ==
Date: Fri, Jul 31 2009 3:48 am
From: Georg Bauhaus
Isaac Gouy schrieb:
> On Jul 30, 10:20 am, Pascal Obry <pas...@obry.net> wrote:
>> Le 30/07/2009 19:09, fft1976 a écrit :
>>
>>> Can Ada be asked to inline automatically?
>> Yes. See gnatmake's options -gnatn and -gnatN. Some inlining are also
>> done at -O3 IIRC.
>
>
> "Activate inlining for subprograms for which pragma inline is
> specified" gives the impression that both a source code change -
> pragma Inline(Select_Random); - and a compiler switch change would be
> needed?
In this case, yes, both pragma Inline and -gnatn -gnatN was
used. The Annotated Ada RM says, though, that an implementation
may inline in any case (or not), provided inlining preserves
the semantics. (6.3.2)
== 3 of 4 ==
Date: Fri, Jul 31 2009 4:13 am
From: Georg Bauhaus
fft1976 schrieb:
> On Jul 30, 10:59 am, Isaac Gouy <igo...@yahoo.com> wrote:
>
>> "shaky results"? Didn't you confirm those results yourself?
>
> Perhaps he is referring to I/O being the bottleneck. I have to say, if
> this is true, it undermines the usefulness of the benchmark to me.
I/O and a few other things are necessrily changing over time,
affecting (perceived) results. Without intending any complaint:
programs like the fine tests presented at Shootout will
almost inevitably produce some variation along
several dimensions, and this should be expected:
- compilers change
- system libraries/services change
- I/O routines, string processing, matrix handling and
more are different between languages, and they are not
always srictly isolated into the test programs.
If someone wanted to do this kind of specific comparison,
different programs might profit from slightly different design
guidelines than those you get for free at the Shootout.
- interpretation of result is correspondingly brittle
An example case is asking (or not) which specific part of a
program is causing its overall running time.
When changing the regex-dna program for Ada some
time ago, I noticed that the GNAT's Spitbol pattern matching
is just as fast as the other fast pattern matching specialists
at the time. However, the Ada program gets really busy when
reassembling the result string. So the less astute human
reader might (wrongly) interpret the regex-dna test result as
indication that pattern matching using Ada is not that fast.
Right now the same regex-dna program is failing on the
new Shootout systems; I suspect that the ubiquituous stack size
thing of newer GCCs may be causing this (dictating that stack frames
should be small, i.e. for non-Pascal languages, IIUC);
$ ulimit -s is only partly helpful. I'm looking into this for the
knuleotide test; a patch and more on the latter in c.l.ada.
== 4 of 4 ==
Date: Fri, Jul 31 2009 4:29 am
From: Georg Bauhaus
Isaac Gouy schrieb:
> On Jul 30, 9:10 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
> wrote:
> -snip-
>> Conclusions
>> (so far, if the above can be reproduced):
>>
>> A fair bit of Ada's disadvantage is remedied by using
>> Inline; another drag is Text_IO which is indeed slow.
>> Real world needs might (and will) consider I/O
>> routines that use OS functions, much like C on Unix does,
>> more or less.
>>
>> The seemingly shaky results (if confirmed) also let me
>> think that without constant attention, the Shootout
>> can give a wrong impression (for any language :).
>
>
> "shaky results"? Didn't you confirm those results yourself?
Shaky here should not refer to runs or relative runs of two
specific test programs; the results are stable. However, the
interpretations of Shootout test comparisons are
less stable, as should be expected (more in an other
post). So when comparing programming languages in general,
more care needs to be taken when looking at the (list of)
Shootout programs. They _can_ be informative of language
features if looked at closely. (I.e., a ranking does not
suffice then.)
> Sure we might hope a different program would give better results, and
> instructions for contributing better programs are given in the FAQ.
Better results of programs is not that important here, what is important
is an expectation, namely that the specific programs might demonstrate
eternally frozen, irreplaceable language properties by looking at
accumulated statistical results only.
> -snip-
>> In the overall rating, failing programs or missing programs
>> used to add to where a language was rated IIRC?
>
> Not true for the last several years.
>
Please accept my apologies for being authoritatively
wrong on several accounts. Sorry for misrepresenting
rules. BTW, I couldn't think of a better way to rank
a failed program runs using compiler X and system Y
other than at list position n + k.
==============================================================================
TOPIC: True Religion Jeans - True Religion Mens Jeans
http://groups.google.com/group/comp.lang.c++/t/f04e39a24e30b85e?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Jul 31 2009 3:27 am
From: damo
Designer New Style True Religion Jeans all fine quality.
You can check them:
http://www.luxury-fashion.org/static/Apparels/True-Religion-Mens-Jeans-114.html
If you want find more new fashionable shirts,bags and shoes.
Please view :
www.luxury-fashion.org
You MUST can find what do you want here!
Welcome view our other pages or feel free contact us.
==============================================================================
TOPIC: static inline functions - possible?
http://groups.google.com/group/comp.lang.c++/t/0386357e12bd0064?hl=en
==============================================================================
== 1 of 4 ==
Date: Fri, Jul 31 2009 3:37 am
From: Stephen Howe
Hi
Is it possible to have static inline member functions of a class?
I dont ever recall seeing "static" and "inline" together.
if so, how is it done ?
I know of inline non-static member functions, either defined within
the class or outside the class body but with "inline" keyword
Thanks
Stephen Howe
== 2 of 4 ==
Date: Fri, Jul 31 2009 3:52 am
From: "Balog Pal"
"Stephen Howe" <sjhoweATdialDOTpipexDOTcom>
>
> Is it possible to have static inline member functions of a class?
Why not?
> I dont ever recall seeing "static" and "inline" together.
With member functions you rarely spell "inline", as just defining the
function within the class makes it inline implicitly. And you must include
the definition of functions just as the definition of the class, so
separation here brings little more pain than just doing the definitions
right at the place.
> if so, how is it done ?
The same way as the regular, just add 'inline' at front. :) Note, that for
member functions you do NOT say 'static', ever, at the implementation point
if it is outside the class def.
== 3 of 4 ==
Date: Fri, Jul 31 2009 5:08 am
From: Juha Nieminen
Balog Pal wrote:
> With member functions you rarely spell "inline", as just defining the
> function within the class makes it inline implicitly. And you must include
> the definition of functions just as the definition of the class, so
> separation here brings little more pain than just doing the definitions
> right at the place.
It's a question of style, but many people prefer separating the
declaration of a class from the implementation of its inline functions,
to keep the header tidy and clean. (After all, the class declaration
often doubles as a kind of "reference manual" to the usage of the class,
especially in the lack of better documentation, or if the documentation
is impractical to read.)
If you implement the inline function inside the class declaration,
then you can indeed skip the 'inline' keyword, ie:
//-------------------------------------------------------------
// Something.hh
//-------------------------------------------------------------
class Something
{
public:
// Implicitly inline, doesn't need the keyword:
int value() const { return something; }
};
//-------------------------------------------------------------
But if you want to separate the the declaration and the implementation
in the header, you have to specify the 'inline' keyword in the
implementation:
//-------------------------------------------------------------
// Something.hh
//-------------------------------------------------------------
class Something
{
public:
int value() const;
};
// 'inline' is required here:
inline int Something::value() const { return something; }
//-------------------------------------------------------------
As you said, it makes no difference whether the function is also
static or not. Just add the 'static' keyword in the declaration (the
implementation doesn't need it).
== 4 of 4 ==
Date: Fri, Jul 31 2009 5:25 am
From: "Balog Pal"
"Juha Nieminen" <nospam@thanks.invalid>
> Balog Pal wrote:
>> With member functions you rarely spell "inline", as just defining the
>> function within the class makes it inline implicitly. And you must
>> include
>> the definition of functions just as the definition of the class, so
>> separation here brings little more pain than just doing the definitions
>> right at the place.
>
> It's a question of style, but many people prefer separating the
> declaration of a class from the implementation of its inline functions,
> to keep the header tidy and clean. (After all, the class declaration
> often doubles as a kind of "reference manual" to the usage of the class,
> especially in the lack of better documentation, or if the documentation
> is impractical to read.)
Yea, and for many cases the inline implementation documents what the
function does. :)
Where if it wouldn't there are good chances it is not fit for inlining
anyway.
Headers are good as dox, but you're better off to use doxygen or like
system -- so directly reading becomes only task of who changes it, the rest
can read the derived html, that well separates&jons the declarations, the
code, the attached text, no matter how it is spread in the source files.
I worked with those separated inlines -- at a time made some myself, my net
conclusion is it makes things worse.
==============================================================================
TOPIC: SSO
http://groups.google.com/group/comp.lang.c++/t/77f7c1c9190e45a7?hl=en
==============================================================================
== 1 of 2 ==
Date: Fri, Jul 31 2009 3:44 am
From: "Bo Persson"
Juha Nieminen wrote:
> Bo Persson wrote:
>> Juha Nieminen wrote:
>>> Bo Persson wrote:
>>>> This assumes that you pass large strings around by value, but do
>>>> not change them. Is this a common scenario?
>>> Sorting a vector of strings is not all that uncommon.
>>
>> std::sort will use swap which is specialized for std::string, it
>> will just swap the internals.
>
> Most std::sort() implementations use introsort, which in most
> situations triggers an insertion sort, which copies elements,
> doesn't swap them. I checked the implementation used in gcc, and it
> indeed uses straightforward assignments rather than any swapping.
That's an implementation detail.
>
> Also in quicksort there is a pivot value used to partition the
> array. How do you keep this pivot value with swapping only?
You can swap it into the right partition, and then keep a reference to
it.
> I checked the implementation in gcc, and it seems that it uses the
> median-of-three method for choosing the pivot value, and then
> passes it to the partitioning function by value, hence triggering a
> copy.
Passing by value seems expensive for non-COW types. Creating extra
copies of some objects seems a bit expensive, when sort is supposed to
swap them.
Bo Persson
== 2 of 2 ==
Date: Fri, Jul 31 2009 4:58 am
From: Juha Nieminen
Bo Persson wrote:
>> Most std::sort() implementations use introsort, which in most
>> situations triggers an insertion sort, which copies elements,
>> doesn't swap them. I checked the implementation used in gcc, and it
>> indeed uses straightforward assignments rather than any swapping.
>
> That's an implementation detail.
Yes, but my point is that you can't trust that std::sort will only use
swaps eg. with string objects.
==============================================================================
TOPIC: negative powers of two
http://groups.google.com/group/comp.lang.c++/t/50db9695edc9e79f?hl=en
==============================================================================
== 1 of 4 ==
Date: Fri, Jul 31 2009 4:01 am
From: stip
Hello,
given the exponent as integer, what's the fastest way to calculate
negative (and positive) integer powers of two?
std::pow() is quite slow, because designed for the general case.
Do I have to do some bit manipulations on my own or are there already
functions?
Thanks a lot,
Alex
== 2 of 4 ==
Date: Fri, Jul 31 2009 4:55 am
From: SG
On 31 Jul., 13:01, stip wrote:
>
> given the exponent as integer, what's the fastest way to calculate
> negative (and positive) integer powers of two?
> std::pow() is quite slow, because designed for the general case.
> Do I have to do some bit manipulations on my own or are there already
> functions?
There is no portable way to do it as far as i know. You can certainly
write code that exploits the binary representation of doubles. You
could include a test in your build script that tests whether the
assumptions about implementation details are true and defines a
preprocessor name accordingly so you can use #ifdef #else
No comments:
Post a Comment