comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=encomp.lang.c++@googlegroups.com
Today's topics:
* Best way to search through STL maps? - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/7a79fbddf985eea2?hl=en
* friends, templates and comeau, gcc - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/99a5c9e8d832abcb?hl=en
* AutoFlowchart : auto generate flowchart from source code - 1 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/5616ce70ade5faed?hl=en
* fastest way to get a double from a string - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/d15c629d71fd2efc?hl=en
* Order of destruction of static members and static objects - 5 messages, 4
authors
http://groups.google.com/group/comp.lang.c++/t/8c6c8d00ec467068?hl=en
* WWW.TOTRADEA.COM ★NO.1 Quality★ Wholesale Handbags, Edhardy,Gucci,Chanel,LV,
Juicy,UGG,Prada,Coach,D&G,Fendi handbags - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/c23dc88002d330d0?hl=en
* ★→Iphone 3GS and 3G,Nokia N97,N96,Blackberry 9500,9000 fashion mobiles, New,
unlocked,one year warranty - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/7a66459a6e89a7d3?hl=en
* =♡*★*♡=HOT SALE Nike,Jordan,Shox,Max,Dunk,Gucci,Supra,Edhardy,Lacoste,Adidas,
Prada,Doir,Lanvin,Hogan sneakers - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/a10d063258c67743?hl=en
* Looking for a good memory and CPU profiler - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/ac40d4006ea2c71c?hl=en
* Cheap Wholesale& Retail GHD discount GHD straightener (www.dotradenow.com.cn)
- 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/8f0a7c92d1acebaa?hl=en
* Article on possible improvements to C++ - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/e46e9b3e07711d05?hl=en
* how to achieve low latency in C++ - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/a27acf7c042642e9?hl=en
* What is fastest? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/917a17e130cd2dc9?hl=en
==============================================================================
TOPIC: Best way to search through STL maps?
http://groups.google.com/group/comp.lang.c++/t/7a79fbddf985eea2?hl=en
==============================================================================
== 1 of 4 ==
Date: Mon, Nov 30 2009 6:18 am
From: er
> (I really should investigate Boost, but a quick search reveals people
> having nightmares building it for OSX due to the transition to 64-bit,
> so I'll have to hold off for a while.)
FYI I was able to build a couple of the boost libraries (the bulk of
boost does not need installing) on Snow Leopard (64-bit). Some of the
searches you found probably pertain to advanced features that you
probably don't need.
== 2 of 4 ==
Date: Mon, Nov 30 2009 7:46 am
From: Jeff Flinn
Steve wrote:
> On 29 Nov, 23:00, er <erwann.rog...@gmail.com> wrote:
>> On Nov 29, 5:28 pm, Steve <petertwoca...@googlemail.com> wrote:
>>
>>> On 29 Nov, 19:37, er <erwann.rog...@gmail.com> wrote:
>>>> Does the question boil down to finding whether
>>>> [the] [cat] [sat] [on] [the] [mat]
>>>> matches
>>>> [the] [cat] [sat] [?] [the] [mat]
>>>> where each of the above n-grams are represented by a collection of
>>>> strings and symbol ? is not a question mark but a wildcard?
>>> Yes, succinctly put.
>> I have a feeling (yes, nothing more reliable than that as I don't deal
>> text processing) that working with strings might be easier than
>> breaking them into tokens that are held by a STL container. And do so
>> using C++ I would look into Boost.Regex. But probably you already
>> thought of this and have a good reason to use tokens.
>
> Yes, but having still found no shortcuts, I'm beginning to think that
> keeping composite string copies for searching is the way to go.
> (I really should investigate Boost, but a quick search reveals people
> having nightmares building it for OSX due to the transition to 64-bit,
> so I'll have to hold off for a while.)
Did you mean this:
> it was reported that in Snow Leopard, Apple has removed support for
> ppc64, and folks trying to use that receive fairly obscure errors.
> Some of Boost users were already confused by this. Now, this is
> of course more like Apple's problem, but here's a patch, against
> current trunk, to do a nice diagnostic of this in Boost.Build.
> The intention is that if you try to build just ppc64, or a two-way
> fat binary including ppc64 you get an error message, and if you
> try tobuild 4-way fat binary, ppc64 is skipped and you get 3-way
> binary.
Jeff
== 3 of 4 ==
Date: Mon, Nov 30 2009 8:43 am
From: Steve
On 30 Nov, 15:46, Jeff Flinn <TriumphSprint2...@hotmail.com> wrote:
> Steve wrote:
> > On 29 Nov, 23:00, er <erwann.rog...@gmail.com> wrote:
> >> On Nov 29, 5:28 pm, Steve <petertwoca...@googlemail.com> wrote:
>
> >>> On 29 Nov, 19:37, er <erwann.rog...@gmail.com> wrote:
> >>>> Does the question boil down to finding whether
> >>>> [the] [cat] [sat] [on] [the] [mat]
> >>>> matches
> >>>> [the] [cat] [sat] [?] [the] [mat]
> >>>> where each of the above n-grams are represented by a collection of
> >>>> strings and symbol ? is not a question mark but a wildcard?
> >>> Yes, succinctly put.
> >> I have a feeling (yes, nothing more reliable than that as I don't deal
> >> text processing) that working with strings might be easier than
> >> breaking them into tokens that are held by a STL container. And do so
> >> using C++ I would look into Boost.Regex. But probably you already
> >> thought of this and have a good reason to use tokens.
>
> > Yes, but having still found no shortcuts, I'm beginning to think that
> > keeping composite string copies for searching is the way to go.
> > (I really should investigate Boost, but a quick search reveals people
> > having nightmares building it for OSX due to the transition to 64-bit,
> > so I'll have to hold off for a while.)
>
> Did you mean this:
>
> > it was reported that in Snow Leopard, Apple has removed support for
> > ppc64, and folks trying to use that receive fairly obscure errors.
> > Some of Boost users were already confused by this. Now, this is
> > of course more like Apple's problem, but here's a patch, against
> > current trunk, to do a nice diagnostic of this in Boost.Build.
> > The intention is that if you try to build just ppc64, or a two-way
> > fat binary including ppc64 you get an error message, and if you
> > try tobuild 4-way fat binary, ppc64 is skipped and you get 3-way
> > binary.
>
> Jeff
Yes, not that exact message, but the gist of it. Well, it looks like
it's worth persevering then.
== 4 of 4 ==
Date: Mon, Nov 30 2009 10:17 am
From: er
> > > it was reported that in Snow Leopard, Apple has removed support for
> > > ppc64, and folks trying to use that receive fairly obscure errors.
> > > Some of Boost users were already confused by this. Now, this is
> > > of course more like Apple's problem, but here's a patch, against
> > Jeff
>
> Yes, not that exact message, but the gist of it. Well, it looks like
> it's worth persevering then.
Does ppc64 concern you? Not me, so I did not need a patch.
==============================================================================
TOPIC: friends, templates and comeau, gcc
http://groups.google.com/group/comp.lang.c++/t/99a5c9e8d832abcb?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Nov 30 2009 6:21 am
From: "Johannes Schaub (litb)"
werasm wrote:
> Hi all,
>
> I have this (minimal) piece of code that does not compile under comeau
> (online) and gcc 4.2.1.
>
> namespace n{
>
> template <class T> struct X
> {
> friend int foo( X ){ return 0; }
> };
>
> }//!n
>
> int main()
> {
> n::X<int> x;
> return n::foo( x );
> }
>
> Comeau output:
>
> "ComeauTest.c", line 15: error: namespace "n" has no member "foo"
> return n::foo( x );
>
> When removing the namespace qualification, everything compiles fine,
> therefore...
> [...as before...]
> int main()
> {
> n::X<int> x;
> return foo( x );
> }
>
> ...now compiles without errors.
>
> Changing the example slightly to here below:
>
> namespace n{
>
> template <class T> class X;
>
> template <class T> int foo( X<T> )
> { return 0; }
>
> template <class T>
> struct X
> {
> friend int foo<>( X<T> );
> };
>
> }//!n
>
> int m()
> {
> n::X<int> x;
> return n::foo( x );
> }
>
> Does not result in the error (irrespective of whether n is qualified
> or not). I have not checked gcc with respect to this.
>
> Can anybody perhaps give an explanation concerning this behaviour. Is
> this perhaps a compiler bug?
>
This is how it is supposed to work. You have to differentiate:
- Introducing a name into a declarative region.
- Introducing a *visible* name into a declarative region.
- Putting a declaration directly into a declarative region.
Visibility is a property of names that make them visible to unqualified name
lookup (a name can be hidden when doing "inside out" lookup, from nested
regions to outer regions).
Normally, declarations introduce visible names into a declarative region
(namespace body, class body, ...). Certain declarations introduce names, but
the name is not visible when looked up in that declarative region:
void f() { extern int a; /* visible here */ }
void g() { a; /* error: 'a' not visible */ }
void h() {
extern float a; /* error: a introduced as int variable already */
}
extern float a; /* same error */
extern int a; /* alright, now it's visible ("in scope") from here */
A friend declaration acts similar, as it introduces a name not into the
region the declaration appears in, but into the nearest enclosing namespace
scope, as a not visible name:
struct A { friend void f(); friend void g(); };
int main() { f(); } // error: f not visible
int g(); // error: void g(); and int g(); not overloadable
That was unqualified name lookup without considering ADL (argument dependent
lookup). ADL says:
"When an unqualified name is used as the postfix-expression in a function
call (5.2.2), other namespaces not considered during the usual unqualified
lookup (3.4.1) may be searched, and namespace-scope friend function
declarations (11.4) not otherwise visible may be found."
You may wonder how it knows "f()" is a function call, even though it doesn't
yet know that "f" is a function: This is because every other syntax that
matches "f()" is constrained: "f" needs to be a type name, for instance (see
3.4.1/3). But as a function call, we don't need constraints. Now, the friend
declaration within the class' declarative region that declared a namespace
scope function is considered in addition and is visible to ADL, since a
function argument of your call was a class that contained that declaration.
That was the unqualified case. If you consider qualified-lookup into a
namespace, like "n::f", then it will lookup in declarations that occured in
that namespace (and as a special case, considering using-directives too
("using namespace ...")). However, your friend declaration appeared not in
that namespace, and you did not have an explicit declaration of it in that
namespace. Thus, there is no declaration found.
== 2 of 3 ==
Date: Mon, Nov 30 2009 9:27 am
From: werasm
On Nov 30, 4:21 pm, "Johannes Schaub (litb)" <schaub-johan...@web.de>
wrote:
> This is how it is supposed to work. You have to differentiate:
>
> - Introducing a name into a declarative region.
> - Introducing a *visible* name into a declarative region.
> - Putting a declaration directly into a declarative region.
OK
> A friend declaration acts similar, as it introduces a name not into the
> region the declaration appears in, but into the nearest enclosing namespace
> scope, as a not visible name:
Therefore:
Defining a friend inside a class introduces the name into the
declarative region of the nearest inclosing namespace scope, but as an
invisible name that is only found by ADL (and cannot be found when
qualified).
Do you have any idea why they would want to make it invisible (in the
enclosing namespace scope) in the first place (as a matter of
interest)? i.e. Is it beneficial in any way to have it invisible?
Thank you for your explanation and kind regards,
Werner
== 3 of 3 ==
Date: Mon, Nov 30 2009 9:55 am
From: James Kanze
On Nov 30, 11:58 am, werasm <wer...@gmail.com> wrote:
> I have this (minimal) piece of code that does not compile
> under comeau (online) and gcc 4.2.1.
> namespace n{
> template <class T> struct X
I don't think the fact that X is a template is relevant here. I
think you'll have the same problem with an ordinary class.
> {
> friend int foo( X ){ return 0; }
> };
> }//!n
> int main()
> {
> n::X<int> x;
> return n::foo( x );
> }
> Comeau output:
> "ComeauTest.c", line 15: error: namespace "n" has no member "foo"
> return n::foo( x );
A better message would be ``namespace "n" has no visible member
"foo"''. Namespace n clearly has a member foo, but it's not
been declared in a scope which would make it visible here.
> When removing the namespace qualification, everything compiles fine,
> therefore...
> [...as before...]
> int main()
> {
> n::X<int> x;
> return foo( x );
> }
Yep. When you say n::..., you're telling the compiler
explicitly to look at what is visible in n (which doesn't
necessarily contain everything that is in n). When you leave
the qualification off, you're telling the compiler to look at
what is normally visible at the call site, *and* at any
additional scopes introduced by ADL. In this case, ADL
introduces the scope of n::X, and in the scope of n::X, there is
a declaration which makes n::foo visible.
> ...now compiles without errors.
> Changing the example slightly to here below:
> namespace n{
> template <class T> class X;
> template <class T> int foo( X<T> )
> { return 0; }
> template <class T>
> struct X
> {
> friend int foo<>( X<T> );
> };
> }//!n
> int m()
> {
> n::X<int> x;
> return n::foo( x );
> }
> Does not result in the error (irrespective of whether n is
> qualified or not). I have not checked gcc with respect to
> this.
> Can anybody perhaps give an explanation concerning this
> behaviour. Is this perhaps a compiler bug?
No bug, although probably not very intuitive. Just because
something exists in a given namespace doesn't mean that it is
visible in a given scope. A declaration must be visible in that
scope for it to be visible. A friend declaration isn't in the
surrounding namespace scope, but rather in the class, so it
only makes the symbol visible in the class scope. In your last
example, you have a declaration in the scope itself, so the
symbol becomes visible anytime lookup considers the scope.
--
James Kanze
==============================================================================
TOPIC: AutoFlowchart : auto generate flowchart from source code
http://groups.google.com/group/comp.lang.c++/t/5616ce70ade5faed?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 6:45 am
From: "fenglinyushu@163.com"
AutoFlowchart v2.4.6 is released!
-------------------------------------------------------------
AutoFlowchart is a excellent source code flowcharting tool to
generate
flowchart from source code. Its flowchart can expand and shrink. and
you can
pre-define the the width , height,Horizontal spacing and vertical
spacing.
Move and zoom is also very easy. It can export the flowchart as a
Microsoft
Visio,Word file or a bitmap file. It can help programmers understand,
document and visualize source code.
It supports C,C++,VC++(Visual C++ .NET),Delphi(Object Pascal).
Maybe it can help you!
What's New
-------------------------------------------------------------
1. update function to get function/procedure list;
2. add procession to "try" and "catch" statement;
3. fixed a bug when draw flowchart;
http://www.ezProg.com
==============================================================================
TOPIC: fastest way to get a double from a string
http://groups.google.com/group/comp.lang.c++/t/d15c629d71fd2efc?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Nov 30 2009 7:18 am
From: Juha Nieminen
aaragon wrote:
> However, there has to be a faster way to accomplish this
const char *startPtr = s.c_str(), *endpPtr;
double x = std::strtod(startPtr, &endPtr);
if(endPtr == startPtr) { /* error */ }
It's much faster because strtod (most probably) parses the string
in-place, unlike std::istringstream, which probably copies the string
for itself.
== 2 of 3 ==
Date: Mon, Nov 30 2009 7:43 am
From: aaragon
On Nov 30, 9:18 am, Juha Nieminen <nos...@thanks.invalid> wrote:
> aaragon wrote:
> > However, there has to be a faster way to accomplish this
>
> const char *startPtr = s.c_str(), *endpPtr;
> double x = std::strtod(startPtr, &endPtr);
> if(endPtr == startPtr) { /* error */ }
>
> It's much faster because strtod (most probably) parses the string
> in-place, unlike std::istringstream, which probably copies the string
> for itself.
Thank you for your answers. I tried lexical_cast, and it is actually
slower than the stream_cast function above. I will try the strtod.
Thanks again.
== 3 of 3 ==
Date: Mon, Nov 30 2009 7:41 am
From: "Johannes Schaub (litb)"
aaragon wrote:
> Hi everyone,
>
> I know that to obtain a double from a string, you can use something
> like the following (from the C++-FAQ):
>
> template <typename T>
> T stream_cast(std::string& s) {
>
> T x;
> static std::stringstream iss;
> iss.clear();
> iss.str(s);
> iss>>x;
> if (!iss) {
> std::string err("*** ERROR *** ");
> err += s + " cannot be converted to expected type with type id:\n";
> err += typeid(x).name();
> throw std::runtime_error(err);
> }
> return x;
> }
>
> However, there has to be a faster way to accomplish this, and to fall
> back to this implementation if things don't go as expected. Is what
> I'm thinking possible? Could I use a try/catch block on the <cstdlib>
> function stof()?
>
strstream combines flexibility of c++ with the speed of strtod:
istrstream s(str.c_str());
double d; if(s >> d >> ws && ws.eof()) cout << "converted: " << d;
==============================================================================
TOPIC: Order of destruction of static members and static objects
http://groups.google.com/group/comp.lang.c++/t/8c6c8d00ec467068?hl=en
==============================================================================
== 1 of 5 ==
Date: Mon, Nov 30 2009 7:21 am
From: Juha Nieminen
James Kanze wrote:
>> But does that ensure that it's not accessed after it has been
>> destroyed? If not, how do you make sure it's not?
>
> std::vector< int >&
> sharedContainer()
> {
> static std::vector< int >* theOneAndOnly = new std::vecctor< int >;
> return *theOneAndOnly;
> }
>
> The standard singleton idiom, in fact.
So you mean that you have to deliberately introduce a memory leak if
you want to make sure the container is not accessed after it has been
destroyed?
Is there *really* no better way of doing it?
== 2 of 5 ==
Date: Mon, Nov 30 2009 7:23 am
From: Juha Nieminen
James Kanze wrote:
> On Nov 28, 3:26 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
>> Victor Bazarov wrote:
>>> Apparently you need 'A::container' to be a singleton. See
>>> any of the existing implementations of that pattern. Most
>>> simple ones actually create the singleton on demand (in
>>> freestore) and never destroy it.
>
>> You mean that if you want to make sure that a static member is
>> never accessed after it has been destroyed, you have to
>> allocate it dynamically and purposefully leak it?
>
> That's the usual singleton idiom.
I would have never thought at a programming idiom requires deliberate
introduction of a memory leak into your program. Is it really the only way?
== 3 of 5 ==
Date: Mon, Nov 30 2009 8:13 am
From: "Balog Pal"
"Juha Nieminen" <nospam@thanks.invalid>
>> That's the usual singleton idiom.
>
> I would have never thought at a programming idiom requires deliberate
> introduction of a memory leak into your program. Is it really the only
> way?
Look up the Alexandrescu-singleton
== 4 of 5 ==
Date: Mon, Nov 30 2009 9:23 am
From: Vladimir Jovic
Juha Nieminen wrote:
> James Kanze wrote:
>>> But does that ensure that it's not accessed after it has been
>>> destroyed? If not, how do you make sure it's not?
>> std::vector< int >&
>> sharedContainer()
>> {
>> static std::vector< int >* theOneAndOnly = new std::vecctor< int >;
>> return *theOneAndOnly;
>> }
>>
>> The standard singleton idiom, in fact.
>
> So you mean that you have to deliberately introduce a memory leak if
> you want to make sure the container is not accessed after it has been
> destroyed?
>
> Is there *really* no better way of doing it?
How about this:
class SharedContainer
{
public:
SharedContainer()
{
if ( 0 == Counter() )
{
c() = new Container;
}
++Counter();
}
~SharedContainer()
{
--Counter();
if ( 0 == Counter() )
{
delete c();
}
}
Container& GetContainer()
{
assert( NULL != c() );
return *c();
}
private:
Container *& c()
{
static Container *c = NULL;
return c;
}
int& Counter()
{
static int n = 0;
return n;
}
};
warning : I haven't tested this, but I am sure you got an idea ;)
--
ultrasound www.ezono.com
== 5 of 5 ==
Date: Mon, Nov 30 2009 10:05 am
From: James Kanze
On Nov 30, 3:21 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
> James Kanze wrote:
> >> But does that ensure that it's not accessed after it has been
> >> destroyed? If not, how do you make sure it's not?
> > std::vector< int >&
> > sharedContainer()
> > {
> > static std::vector< int >* theOneAndOnly = new std::vecctor< int >;
> > return *theOneAndOnly;
> > }
> > The standard singleton idiom, in fact.
> So you mean that you have to deliberately introduce a memory
> leak if you want to make sure the container is not accessed
> after it has been destroyed?
How are you defining "memory leak". I don't see anything which
could be qualified as a memory leak, with any of the usual
definitions.
The only useful definition is "memory which leaks"; i.e. which
is periodically reallocated, with previous allocations going
unused, so that the program grows indefinitely. That's not the
case here. I have seen it defined as memory which can no longer
be accessed, because there are no more pointers to it; the only
use I can think of for this definition is to prove that you
can't get a memory leak with garbage collection. But the above
doesn't leak by this definition either, since there's always a
pointer to it.
> Is there *really* no better way of doing it?
It being? And "better" meaning?
If the goal is to ensure that an object is not destructed (which
is what you want here), then I don't know of any better way of
doing it than using an allocation without a delete.
--
James Kanze
==============================================================================
TOPIC: WWW.TOTRADEA.COM ★NO.1 Quality★ Wholesale Handbags, Edhardy,Gucci,
Chanel,LV,Juicy,UGG,Prada,Coach,D&G,Fendi handbags
http://groups.google.com/group/comp.lang.c++/t/c23dc88002d330d0?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 7:31 am
From: "www.toptradea.com"
WWW.TOTRADEA.COM ★NO.1 Quality★ Wholesale Handbags,
Edhardy,Gucci,Chanel,LV,Juicy,UGG,Prada,Coach,D&G,Fendi handbags
"Handbag {www.toptradea.com }
Burberrys Handbag {www.toptradea.com }
Prada Handbag {www.toptradea.com }
Juicy Handbag {www.toptradea.com
Ed hardy Handbag {www.toptradea.com }
DB Handbag {www.toptradea.com }
Chloe Handbag {www.toptradea.com }
LV Handbag {www.toptradea.com }
Jimmy Hoo Handbag {www.toptradea.com }
Fendi Handbag {www.toptradea.com }
Coach Handbag {www.toptradea.com }
Gucci Handbag {www.toptradea.com }
Chanel Handbag {www.toptradea.com }
D&G Handbag {www.toptradea.com }
"
"Suite [www.toptradea.com ]
Adidas-suits[www.toptradea.com ]
Bape-suit[www.toptradea.com ]
Juicy-suits[www.toptradea.com ]
Nike-suit[www.toptradea.com ]
"
"Sandal {www.toptradea.com}
D&G-Sandals {www.toptradea.com}
Dior-Sandals {www.toptradea.com}
EdHardy-slipper {www.toptradea.com}
Gucci-sandal {www.toptradea.com}
LV-Sandals {www.toptradea.com}
"
"Jacket www.toptradea.com
Adidas-Jacket www.toptradea.com
Bape-Jacket www.toptradea.com
BBC-Jacket www.toptradea.com
Burberrry-Jacket www.toptradea.com
EdHardy-Jacket www.toptradea.com
CA-Jacket www.toptradea.com
Gstar-Jackets www.toptradea.com
Gucci-Jacket www.toptradea.com
Lacost-Jacket www.toptradea.com"
"Wallets www.toptradea.com
Chanel-Wallets www.toptradea.com
Coach-Wallets www.toptradea.com
D&G-Wallets www.toptradea.com
DB-Wallets www.toptradea.com
Gucci-Wallets www.toptradea.com
Juicy-Wallets www.toptradea.com
LV-Wallets www.toptradea.com
Versace-Wallets www.toptradea.com"
"Welcome to our website www.toptradea.com ,if you are looking for the
top quality Iphone,Nokia,blackberry,htc,mobile phones, shoes and
clothes ,high quality, Quick shipment,Lowest price and Good service,
please contact with us.
Toptradeing Co.,Ltd was founded in 1995 and we are an actual
manufacturer and exporter of authentic brand Shoes
(Nike,jordan,Puma,adidas,dunk,shox,rift,....),Coat
(Juicy,Gucci,Gstar,CA,etc) t-shirt
(lacoste,polo,evisu,prada,bape),jeans( artful
dodger ,Evisu,bape,DG,Gucci,true religion,bbc jeans ,levus
jeans),handbags (gucci,lv,burberry,chanel,coach,Edhardy,dior) jackets
( Gucci,lv,rolex,bape,omega,Gucci,lv,rolex,bape),Suits
(juicy,Edhardy,Bape,etc),Dress
(Gucci,Armani,MiuMiu,Fendi,SF,Chloe,Yiand,Burberry,Lanvin,MJ,Karen
Millen,Maxmara,Sanshai,BCBG,Missoni,etc),Pants,Jersey
(NBA,NFL),hats,sunglasses
(Edhardy,Chanel,DG,Gucci,Dior,Coach,Armani,Prada,LV,Fedi,Catier,Ferri,Diesel,Burberry)
and strap,Wallets jewelry(Necklace, Chanel, Coach, D&G, Dior, Juicy,
Tiffany Necklace),etc
Currently, we can accept small orders. The more you order, the lower
the price will be. Based on our experience and successful performance
in the worldmarket ;Shoes market, we would like to tell you that we
are operating our own International Marketing Division with
experiences, so we can help our customers with many types of
shoes ,jeans,t-shirt,bags ,and othe products. we are confident that we
will be able to cooperate with your firm with high quality products at
competitive price.
For the price list and delivery time, would you please view our
website www toptradea com.And if any question, please do not hesitate
to contact with me.
Welcome to add my MSN.
Contact: selina
Phone: 86-593-2892302 Skype:toptradea
MSN: toptradea@hotmail.com
Email: toptradea@gmail.com
website: http://www.toptradea.com"
==============================================================================
TOPIC: ★→Iphone 3GS and 3G,Nokia N97,N96,Blackberry 9500,9000 fashion mobiles,
New,unlocked,one year warranty
http://groups.google.com/group/comp.lang.c++/t/7a66459a6e89a7d3?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 7:33 am
From: "www.toptradea.com"
★→Iphone 3GS and 3G,Nokia N97,N96,Blackberry 9500,9000 fashion
mobiles, New,unlocked,one year warranty
"Apple [www.toptradea.com ]
Nokia [www.toptradea.com ]
Blackberry [www.toptradea.com ]
Samsung [www.toptradea.com ]
Sony Ericsson [www.toptradea.com ]
HTC [www.toptradea.com ]
"
"Welcome to our website www.toptradea.com ,if you are looking for the
top quality Iphone,Nokia,blackberry,htc,mobile phones, shoes and
clothes ,high quality, Quick shipment,Lowest price and Good service,
please contact with us.
Toptradeing Co.,Ltd was founded in 1995 and we are an actual
manufacturer and exporter of authentic brand Shoes
(Nike,jordan,Puma,adidas,dunk,shox,rift,....),Coat
(Juicy,Gucci,Gstar,CA,etc) t-shirt
(lacoste,polo,evisu,prada,bape),jeans( artful
dodger ,Evisu,bape,DG,Gucci,true religion,bbc jeans ,levus
jeans),handbags (gucci,lv,burberry,chanel,coach,Edhardy,dior) jackets
( Gucci,lv,rolex,bape,omega,Gucci,lv,rolex,bape),Suits
(juicy,Edhardy,Bape,etc),Dress
(Gucci,Armani,MiuMiu,Fendi,SF,Chloe,Yiand,Burberry,Lanvin,MJ,Karen
Millen,Maxmara,Sanshai,BCBG,Missoni,etc),Pants,Jersey
(NBA,NFL),hats,sunglasses
(Edhardy,Chanel,DG,Gucci,Dior,Coach,Armani,Prada,LV,Fedi,Catier,Ferri,Diesel,Burberry)
and strap,Wallets jewelry(Necklace, Chanel, Coach, D&G, Dior, Juicy,
Tiffany Necklace),etc
Currently, we can accept small orders. The more you order, the lower
the price will be. Based on our experience and successful performance
in the worldmarket ;Shoes market, we would like to tell you that we
are operating our own International Marketing Division with
experiences, so we can help our customers with many types of
shoes ,jeans,t-shirt,bags ,and othe products. we are confident that we
will be able to cooperate with your firm with high quality products at
competitive price.
For the price list and delivery time, would you please view our
website www toptradea com.And if any question, please do not hesitate
to contact with me.
Welcome to add my MSN.
Contact: selina
Phone: 86-593-2892302 Skype:toptradea
MSN: toptradea@hotmail.com
Email: toptradea@gmail.com
website: http://www.toptradea.com"
==============================================================================
TOPIC: =♡*★*♡=HOT SALE Nike,Jordan,Shox,Max,Dunk,Gucci,Supra,Edhardy,Lacoste,
Adidas,Prada,Doir,Lanvin,Hogan sneakers
http://groups.google.com/group/comp.lang.c++/t/a10d063258c67743?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 7:59 am
From: "www.toptradea.com"
=♡*★*♡=HOT SALE
Nike,Jordan,Shox,Max,Dunk,Gucci,Supra,Edhardy,Lacoste,Adidas,Prada,Doir,Lanvin,Hogan
sneakers
"Asics causal shoes www.toptradea.com ,
Creative Recreation causal shoes www.toptradea.com ,
Coogi causal shoes www.toptradea.com ,
Clarks causal shoes www.toptradea.com ,
Dkny causal shoes www.toptradea.com ,
Hogan causal shoes www.toptradea.com ,
Supra causal shoes www.toptradea.com ,
DG causal shoes www.toptradea.com ,
Edhardy causal shoes www.toptradea.com ,
Lacoste causal shoes www.toptradea.com ,
Puma causal shoes www.toptradea.com ,
Coach causal shoes www.toptradea.com "
"Adidas Shoes sneaker www.toptradea.com
Adidas-Good-Year sneaker www.toptradea.com
Adidas-Good-Year2 sneaker www.toptradea.com
+Puma Shoes sneaker www.toptradea.com
Puma-woman-shoes sneaker www.toptradea.com
Puma-man-shoes sneaker www.toptradea.com
Puma-centennial sneaker www.toptradea.com
Puma sneaker www.toptradea.com
Puma-6 sneaker www.toptradea.com
Puma-new sneaker www.toptradea.com
Puma-Kimi-Rainkkonen sneaker www.toptradea.com
Puma-Anniversary sneaker www.toptradea.com
Puma-8813 sneaker www.toptradea.com
Puma-5 sneaker www.toptradea.com
+Nike Blazer sneaker www.toptradea.com
Nike-Blazer sneaker www.toptradea.com
+Edhardy Shoes sneaker www.toptradea.com
man-shoes sneaker www.toptradea.com
canvas-low-shoes sneaker www.toptradea.com
woman-shoes sneaker www.toptradea.com
Casual-shoes sneaker www.toptradea.com
canvas-high-shoes sneaker www.toptradea.com
+Gucci Shoes sneaker www.toptradea.com
Gucci-size14 sneaker www.toptradea.com
Man-low-shoes sneaker www.toptradea.com
woman-high-shoes sneaker www.toptradea.com
Gucci-shoes-A sneaker www.toptradea.com
Man-high-shoes sneaker www.toptradea.com
woman-low-shoes sneaker www.toptradea.com
+Lacoste Shoes sneaker www.toptradea.com
Lacoste-woman-shoes sneaker www.toptradea.com
Lacoste-man-shoes sneaker www.toptradea.com
Lacoste-white-man sneaker www.toptradea.com
+Prada Shoes sneaker www.toptradea.com
Prada-shoes sneaker www.toptradea.com
+Chanel Shoes sneaker www.toptradea.com
Chanel woman shoes sneaker www.toptradea.com
+Coach Shoes sneaker www.toptradea.com
Coach-woman-shoes sneaker www.toptradea.com
Coach-man-shoes sneaker www.toptradea.com
+D&G Shoes sneaker www.toptradea.com "
"Welcome to our website www.toptradea.com ,if you are looking for the
top quality Iphone,Nokia,blackberry,htc,mobile phones, shoes and
clothes ,high quality, Quick shipment,Lowest price and Good service,
please contact with us.
Toptradeing Co.,Ltd was founded in 1995 and we are an actual
manufacturer and exporter of authentic brand Shoes
(Nike,jordan,Puma,adidas,dunk,shox,rift,....),Coat
(Juicy,Gucci,Gstar,CA,etc) t-shirt
(lacoste,polo,evisu,prada,bape),jeans( artful
dodger ,Evisu,bape,DG,Gucci,true religion,bbc jeans ,levus
jeans),handbags (gucci,lv,burberry,chanel,coach,Edhardy,dior) jackets
( Gucci,lv,rolex,bape,omega,Gucci,lv,rolex,bape),Suits
(juicy,Edhardy,Bape,etc),Dress
(Gucci,Armani,MiuMiu,Fendi,SF,Chloe,Yiand,Burberry,Lanvin,MJ,Karen
Millen,Maxmara,Sanshai,BCBG,Missoni,etc),Pants,Jersey
(NBA,NFL),hats,sunglasses
(Edhardy,Chanel,DG,Gucci,Dior,Coach,Armani,Prada,LV,Fedi,Catier,Ferri,Diesel,Burberry)
and strap,Wallets jewelry(Necklace, Chanel, Coach, D&G, Dior, Juicy,
Tiffany Necklace),etc
Currently, we can accept small orders. The more you order, the lower
the price will be. Based on our experience and successful performance
in the worldmarket ;Shoes market, we would like to tell you that we
are operating our own International Marketing Division with
experiences, so we can help our customers with many types of
shoes ,jeans,t-shirt,bags ,and othe products. we are confident that we
will be able to cooperate with your firm with high quality products at
competitive price.
For the price list and delivery time, would you please view our
website www toptradea com.And if any question, please do not hesitate
to contact with me.
Welcome to add my MSN.
Contact: selina
Phone: 86-593-2892302 Skype:toptradea
MSN: toptradea@hotmail.com
Email: toptradea@gmail.com
website: http://www.toptradea.com"
==============================================================================
TOPIC: Looking for a good memory and CPU profiler
http://groups.google.com/group/comp.lang.c++/t/ac40d4006ea2c71c?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Nov 30 2009 8:16 am
From: Johnson
Andy Champ wrote:
> Johnson wrote:
>> Thanks for the info, Ian. This project is developed under Microsoft
>> Visual C++ 2008. Do you have any recommendation for trhe profiler?
>> BTW, can you recommend me a few relevant forum?
>
> Microsoft Visual C++ 2008 has a profiler built in. Or at least, it did
> last week when I was profiling madly...
>
> Look for Analyze [sic] on the menus.
>
> Which edition do you have?
>
> Andy
Thank you, Andy, I am using Visual C++ 2008 Express Edition. Does it
have the tools you mentioned?
Johnson
== 2 of 2 ==
Date: Mon, Nov 30 2009 8:38 am
From: André Schreiter
Johnson schrieb:
> Andy Champ wrote:
> Thank you, Andy, I am using Visual C++ 2008 Express Edition. Does it
> have the tools you mentioned?
No, only Visual Studio Team System has it.
==============================================================================
TOPIC: Cheap Wholesale& Retail GHD discount GHD straightener (www.dotradenow.
com.cn)
http://groups.google.com/group/comp.lang.c++/t/8f0a7c92d1acebaa?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 9:01 am
From: yoyotrade
GHD MK4 MK5 cheap Wholesale, GHD hair straightener wholesale
Cheap Benefit GHD (www.dotradenow.com.cn)
Cheap Black GHD (www.dotradenow.com.cn)
Cheap Dark GHD (www.dotradenow.com.cn)
Cheap pink GHD (www.dotradenow.com.cn)
Cheap new style Leopard GHD (www.dotradenow.com.cn)
Cheap IV mini styler GHD (www.dotradenow.com.cn)
Cheap rare Leopard GHD (www.dotradenow.com.cn)
Cheap rare newest Leopard style (www.dotradenow.com.cn)
Cheap Gold GHD (www.dotradenow.com.cn)
Cheap Kiss GHD (www.dotradenow.com.cn)
Cheap pink MK5 (www.dotradenow.com.cn)
Cheap black GHD (www.dotradenow.com.cn)
Cheap limited edition MK5 (www.dotradenow.com.cn)
Cheap pure black GHD MK5 (www.dotradenow.com.cn)
Cheap pure white GHD (www.dotradenow.com.cn)
Cheap Pink style GHD (www.dotradenow.com.cn)
Cheap Purple style GHD with dryer (www.dotradenow.com.cn)
Cheap Salon GHD (www.dotradenow.com.cn)
CHI
Cheap Ammy green CHI (www.dotradenow.com.cn)
Cheap Black style CHI (www.dotradenow.com.cn)
Cheap Blue style CHI (www.dotradenow.com.cn)
Cheap Camouflage Blue CHI (www.dotradenow.com.cn)
Cheap Camouflage pink CHI (www.dotradenow.com.cn)
Cheap Peachblow CHI (www.dotradenow.com.cn)
Cheap Pink style CHI (www.dotradenow.com.cn)
Cheap Red-black CHI (www.dotradenow.com.cn)
Cheap Wide red-black CHI(www.dotradenow.com.cn)
Cheap crimping iron (www.dotradenow.com.cn)
==============================================================================
TOPIC: Article on possible improvements to C++
http://groups.google.com/group/comp.lang.c++/t/e46e9b3e07711d05?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 9:41 am
From: James Kanze
On Nov 30, 10:11 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On 27 Nov, 10:59, "Balog Pal" <p...@lib.hu> wrote:
> > "NickKeighley" <nick_keighley_nos...@hotmail.com>
> <snip>
> > >> OTOH, the real way to make correct code is definitely not
> > >> going by that info but through using consistent RAII-like
> > >> handling, and reviews enforcing it.
> > >I keep on seeing things like this. How exactly does RAII
> > >deal with allocations that don't follow a simple [stack
> > >based] model?
> > Insert some example of the model you think problematic.
> anything that doesn't follow a stack model. A graphical
> editor. A mobile phone system. You are at the mercy of the end
> user as to when objects are created and destroyed. With the
> phone system people can drive into tunnels or JCBs (back-hoes)
> can dig up comms links (that really happened once).
Certainly. RAII doesn't apply to entity objects (which means
most dynamically allocated memory). On the other hand, it's
very useful, for enforcing transactional semantics within the
transaction which handles the events: it probably applies to 95%
or more semaphore locks, for example.
> > >> As test runs will hardly cover all possible paths
> > >> including errors and exceptions, so relying on the empty
> > >> leak list from a random run is nothing but illusion of
> > >> being okay. While with trivial style it is easy to make
> > >> leaks impossible.
> > >so explain to me how I trivially remove all possible memory
> > >leaks from my programs.
> > "Remove" is not the way. You start from nothing -- that is
> > assumed leak-free ;-) and add all the stuff in a way that
> > can't leak. So your program is always leak-free.
> ah, my computer science lecturer used to tell us that a blank
> piece of paper had no bugs. Programmers then just went on to
> add bugs.
It's true, and the secret to quality programming is to not add
bugs. That's why people use code review and unit tests and any
number of other techniques (like not writing overly complicated
code to begin with).
> > The style is like:
> > - 'delete' is forbidden in "client" code. It is privilige
> > of the the few library classes that serve as managers.
> > Like auto_ptr.
> and who holds the auto-ptr?
It's a stupid rule anyway. It doesn't work in practice. The
real rule for memory management is not to use dynamic allocation
at all, except when the object lifetime is explicit (e.g. a call
in a telephone system). And of course then, your design (or
more directly, your requirements specification) determines when
the object should be deleted.
> > - The result of every new goes immediately to one such
> > manager. That's about it.
> these things always seem to solve the easy cases (ok they used
> to be the very hard cases!) but not the hard cases.
> > Certainly there are a few cases where ownership is
> > transferred --
> a few!
> > so look what happens to result of release(), Detach() and
> > similar calls, that is IME natural.
> > Same thing applies to other resources: files, handles, GDI
> > resources, locks, transactions.
> except for transactions, yes
> > As an example, you may look some old Petzold examples to
> > struggle with raw WIN API in pure C -- and see how the same
> > thing looks using MFC's CFont, CBrush and similar
> > wrappers.
> I've wrappered Win32 in C++. Yes, RAII makes life easier.
> > The difference is incredible in readability and clearness.
> > As a side effect DBWIN no longer explodes on any random
> > program reporting a zillion of lost resources.
> > If you want a very simple example,
> no, I don't want a simple example
> > think a program that processes text manipulating strings all
> > its time. A C++ solution would use std::string, (or any of
> > the much better string classes). Doing all the
> > passing-around, cutting, concatenating, etc.
> consider a text editor that allows the user to delete text.
> Who deletes the string that holds the deleted stuff and when.
That's probably not a good example. The text buffer holds the
text before it's deleted, and the deleted text itself is never a
separate object, unless...
> What if the editor has Undo/Redo?
Then you save the deleted text in a redo record. Which will be
deleted when the requirements specifications says it should be
deleted.
> > Without having a single new or other allocation in the
> > *client* code of the program.
> the client code is gonna have to do something to trigger the
> new. Call a factory for instance.
Which comes down to the same. Sometimes the factory method is
justified---it may be preferable to check pre-conditions
beforehand, or to register the created object with a transaction
(so it can be correctly deleted in case of rollback).
> > While obvoiusly doing a zillion alllocations and
> > deallocations. Can you describe a way to introduce a leak?
> forget to call the thing that triggers the delete.
> > >> Why invest in better patches instead of cure the problem
> > >> at roots?
> > >because you can't remove the problem at its root. If you
> > >want true dynamic allocation then you need to trigger
> > >delete somehow. Unless you add garbage collection to C++.
> > Sure you can, and many of us do it in practice. C++ has
> > destructors that are called automaticly at well defined
> > points
> the points are not always so well defined.
> > -- and that automation can reliably be used to do the
> > deletes you need. All of them.
> > As, unless you start doing WTF things deliberately just to
> > prove idiots'
> I'm not *trying* to break things.
> > endless resources, destructors will be called matching
> > constructors, and when leaving a scope by *any* means.
> but leaving scope is *not* the correct time to delete some
> objects!
It it is the correct time, then you don't want dynamic
allocation to begin with.
> CallManager::process_event (EventAP event)
> {
> CallAP call = 0;
> if (is_new_call (event))
> {
> call = CallFactory::create_call (event);
> CallList::add_call (call);
> }
> else
> {
> CallAp call = CallList::lookup_call (event);
> }
> call.process_event(event);
> }
> when this finishes the call should very definitly not be
> destroyed! The CallManager (or some class this is delegated
> to has to track what goes into CallList (the list of currently
> active calls) and also be careful about rmoving things from
> it- when they are destroyed.
I'm not sure what CallAP is, but this looks like a familiar
pattern (except that I'd probably keep the newly created call
object in an auto_ptr until I'd successfully returned from
CallList::add_call). And of course, if the event is "hang up",
and that brings the connection count in the call down to zero,
it is the call itself (in a function called from
Call::process_event) which will do the delete.
--
James Kanze
==============================================================================
TOPIC: how to achieve low latency in C++
http://groups.google.com/group/comp.lang.c++/t/a27acf7c042642e9?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 10:50 am
From: Maxim Yegorushkin
bubai wrote:
> Currently I am involved in developing a trading system. The server
> side is written in C++ the agenda here is that the system has to be a
> low latent system.
There are a few fundamental principles you should follow. Your server will
exhibit low latency to the extent you adhere to these principles:
1) Avoid data copying. Prefer zero-copy algorithms. For example, when you
send/receive data through a socket use a ring-buffer with wrapping iterators.
2) Avoid dynamic memory allocation on fast code paths, such as receiving market
data and sending orders. Preallocate as much as possible. Use mapped memory.
3) Avoid lock contention. Use wait-free and lock-free algorithms if possible,
share as little data as possible between threads.
4) Avoid context switching. Don't have more threads ready to run than hardware
CPUs. Use fifo realtime process priority, so that your threads do not get
context switched off when it still has data to process.
One of the top latency killers is formatting strings using things like
std::stringstream or snprintf into std::string. This is because they do a fancy
data copy (1), dynamic memory allocation (2), locking a mutex (3) when doing the
memory allocation (unless some fancy multi-thread allocator is used that avoid
locking a mutex).
> Is there any book or reference or white papers
> which tell us what are the techniques to write low latency code in C+
> +.... Any help will be highly appreciated.
Start with http://www.kegel.com/c10k.html
--
Max
==============================================================================
TOPIC: What is fastest?
http://groups.google.com/group/comp.lang.c++/t/917a17e130cd2dc9?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Nov 30 2009 11:02 am
From: "carl"
What is fastest, indexing or iterating a std::vector:
std::vector<std::string> container;
// Add 100000 strings to container
std::vector<std::string>::iterator it = container.begin()
while (it != container.end()) {
std::string str = *it;
// do something with str
it++;
}
or
int size = container.size();
for (int i=0; i< size; i++) {
std::string str = container[i];
// do something with str
}
On this page:
http://stackoverflow.com/questions/776624/whats-faster-iterating-an-stl-vector-with-vectoriterator-or-with-at
there are some different opinions, but what are your experinces?
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en
To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en