http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* Unique Identifiers - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/4a51924c25f7395a?hl=en
* static member variable - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/e1a69a5a67723783?hl=en
* Templates and typeconversion - question - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/0e404e52077d4648?hl=en
* Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? - 4 messages, 2
authors
http://groups.google.com/group/comp.lang.c++/t/40783f7f814400c9?hl=en
* A silly belief shattered (happily) - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/34c9bf7361966608?hl=en
* ◆♡◆→Wholesale Nokia ,Iphone, Samsung, Blackberry, Sony, Motorola,etc brand
mobiles "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/aba034d13f4c8c8c?hl=en
* ♡◆♡Sneaker of Nike,Jordan,Gucci,Adidas,Puma,EdhardyShox,Max,Free,Rift%Polo,
Lacoste,BBC,Gucci,Armani,LV,Christina Audigier Tshirt and Jeans ♡www.toptradea.
com♡ The best supplier - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/149654c7d9179c99?hl=en
* ☆═━┈Hot sale Fashion Lady Handbags Juicy,Burberry,Gucci,LV,Prada,D&G,Edhardy,
Chanel,Coach, Jimmy-Hoo ♡www.toptradea.com♡ - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/cd952fac818b82ff?hl=en
* how to specify overloaded function - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/26ad21b74db02ab6?hl=en
* Behaviour of istream_iterator on closed stream - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b2854b7eb7f63001?hl=en
* How can I use unqualified names? (Possibly hard or impossible?) - 1 messages,
1 author
http://groups.google.com/group/comp.lang.c++/t/e2f24a95fe72b591?hl=en
* Ed hardy handbags Discount - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/f1e9dda3ad42edee?hl=en
==============================================================================
TOPIC: Unique Identifiers
http://groups.google.com/group/comp.lang.c++/t/4a51924c25f7395a?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Jul 28 2009 3:06 pm
From: Victor Bazarov
blackjack612 wrote:
> I've been trying to come up with a way to efficiently create a unique
> number identifier for a largish array of doubles. [..]
> Does anybody know if it's even possible to do what I'm talking
> about?
Some probably do...
How about explaining (using an example) for the rest of us? WTH do you
mean?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
== 2 of 2 ==
Date: Tues, Jul 28 2009 9:38 pm
From: Mohammad Nabil Al-Aggan
On Jul 29, 1:03 am, blackjack612 <blackjack...@gmail.com> wrote:
> Hi,
>
> I've been trying to come up with a way to efficiently create a unique
> number identifier for a largish array of doubles. I've also been
> checking out the boost libraries hash stuff and am at a loss when
> trying to understand what they do. In the library I'm working on
> (where I use arrays of bits, integers, and doubles), it would be very
> helpful if I was able to represent an array of numeric types with a
> unique identifier. While creating a unique identifier for bits and
> integers isn't much of a problem, creating one for an array of doubles
> is. Does anybody know if it's even possible to do what I'm talking
> about?
>
> Sincerely,
> Ed H
If you are talking about the hash value of an array, depending on the
maximum array length, it might not be unique.
For example if the hash value is 128 bits in length, it can only
represent 2^128 unique identities. That means your array of integers
(assuming 4-byte integers), to be uniquely identifiable with such
mechanism, can not exceed 128 / 32 items. That is 4 items only.
It's basically intuitive. Number of bits in the hash are 128. Number
of bits in 12-item 4-byte-per-item array is also 128 bits.
If you want to uniquely identify X arrays, you need your hash to be
able to represent X different values. Which is not possible for arrays
longer than B bits, where B is the number of bits in the hash.
==============================================================================
TOPIC: static member variable
http://groups.google.com/group/comp.lang.c++/t/e1a69a5a67723783?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 3:34 pm
From: Paul Brettschneider
Juha Nieminen wrote:
> Paul Brettschneider wrote:
>> decltype(A::i) A::i = 0;
>> :-P
>
> I think this would be handier (although I can't say how unambiguous or
> easy to parse it would be):
>
> auto A::i = 0;
Yes, but if I understood the difference between decltype and auto correctly,
the latter would depend on the type of "0" and not of "A::i", as was
intended.
==============================================================================
TOPIC: Templates and typeconversion - question
http://groups.google.com/group/comp.lang.c++/t/0e404e52077d4648?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 5:25 pm
From: "Alf P. Steinbach"
* Victor Bazarov:
> Alf P. Steinbach wrote:
>> * Markus S:
>>> Hi,
>>>
>>> I guess there is a good reason for this, a function from the Boost
>>> library (which finds the minima of given function) has the following
>>> synopsis:
>>>
>>> template <class F, class T>
>>> std::pair<T, T> brent_find_minima(F f, T min, T max, int bits);
>>>
>>> Calling it the following way works (inside main, with a top-level
>>> function TrickyFunc):
>>>
>>> double min = 1;
>>> double max = 100;
>>> int bits = 50;
>>>
>>> std::pair<double, double> result = brent_find_minima(TrickyFunc, min,
>>> max, bits);
>>>
>>> Calling it with the arguments directly given, compiles and runs
>>> 'fine' but fails to iterate and just returns the upper boundary (max).
>>>
>>> std::pair<double, double> result = brent_find_minima(TrickyFunc, 1,
>>> 100, bits);
>>
>> Shouldn't compile really, unless there's something I don't know about
>> std::pair.
>
> You don't know about the templated copy-conversion constructor? Please
> see [lib.pairs]/1.
Thanks. Well nothing surprises me anymore. :-)
[snip]
>>
>> But anyway, express the arguments as 1.0 and 100.0.
>>
>> You need the same numeric type as for the result values.
Cheers,
- Alf
==============================================================================
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: Tues, Jul 28 2009 5:40 pm
From: Oxide Scrubber
fft1976 wrote:
> My needs are similar to yours, and I've been looking for better
> languages and learning them for years.
>
> In summary: everything sucks, when you look close enough.
Except Clojure.
> Java: 1.5x slower than C as a rule of thumb.
I think it can achieve parity.
> Safe, verbose, repetitive, overengineered. Some stuff you get for free
> with C++ and OCaml ("clone") or in OCaml ("marshalling"), you have to
> write by hand in Java for every single class.
Nope. With Java, in most cases you can slap "implements Cloneable" on a
class and make the clone method public, or slap "implements
Serializable" on a class to make its instances marshallable.
Clojure is much better though: safe, non-verbose, non-repetitive, full
access to Java libraries. Clone you mostly don't need as most data
structures are immutable. Anything made purely with numbers, strings,
keywords, symbols, lists, vectors, sets, and maps can be written and
read using Clojure's reader, and can therefore be marshalled easily, and
to a human-editable text file to boot. (This doesn't, however,
interoperate with generic Java objects or Java serialization, and I'm
not sure it works with data structures with circularities. It won't work
with data structures with infinite sequences in them, but if you
represent such sequences symbolically it can.)
Last but not least, numerical Clojure code can fairly easily be tuned to
give comparable performance to C or even hand-tuned assembly, and
Clojure has strong support for parallelism and threading.
> Gambit-C Scheme (one of the best of LISPs, IMO): about 2x slower than
> C
Sucks compared to Clojure.
>(single core only)
Sucks compared to Clojure.
> but you have to work to get within 2x (unlike OCaml)
You need to work a bit to get the most speed out of Clojure too, but you
can then get C-like performance out of it in tight loops.
> and if you want it fast, it can't be safe (switch controlled).
You can have have that cake and eat it too in Clojure, aside from giving
up protection against integer overflow and wrapping for that last bit of
speed in integer operations. (There are "unchecked" integer operations
equivalent to normal C/C++/Java arithmetic on int-like types, and "safe"
ones that promote as needed to int, long, even bignum.)
== 2 of 4 ==
Date: Tues, Jul 28 2009 7:52 pm
From: fft1976
On Jul 28, 5:40 pm, Oxide Scrubber <jharri...@hatlop.de> wrote:
Clojure is kind of cool, but many corrections are in order:
> fft1976 wrote:
> > Java: 1.5x slower than C as a rule of thumb.
>
> I think it can achieve parity.
I disagree. I don't think the JIT can do much about the memory layout
of the data structures. Compare a vector of complex numbers or of 3D
vectors (NOT of pointers to them) in C/C++ and Java. Run some tests. I
did and I looked at others'.
For me, 1.5x is a good trade-off for safety though.
> With Java, in most cases you can slap "implements Cloneable" on a
> class and make the clone method public,
Java's "clone" does a shallow copy only (check the docs). C++ default
copy constructors call copy constructors on the members.
> or slap "implements
> Serializable" on a class to make its instances marshallable.
Does this handle cycles and memory sharing among data structures?
> (This doesn't, however,
> interoperate with generic Java objects or Java serialization, and I'm
> not sure it works with data structures with circularities. It won't work
> with data structures with infinite sequences in them, but if you
> represent such sequences symbolically it can.)
But you'll need Java's data structures and mutations on Java's arrays
to compete with it in speed of numerical code, so this argument goes
out the window.
> Clojure has strong support for parallelism and threading.
Clojure's support for multithreading is good only as long as your code
is pure-functional. Let's see you add 1.0 to all diagonal elements of
a 1000x1000 matrix.
> You need to work a bit to get the most speed out of Clojure too, but you
> can then get C-like performance out of it in tight loops.
In theory, imperative and Java array using Clojure can be made as fast
as Java (which is slower than C), but in practice, experts seem to
agree that Clojure is 5-10 times slower than Java:
http://groups.google.com/group/clojure/msg/92b33476c0507478
Aside: do you remember to add -O3 when you are compiling C/C++? I use
"-server" when running the JVM.
== 3 of 4 ==
Date: Tues, Jul 28 2009 9:46 pm
From: Oxide Scrubber
fft1976 wrote:
> On Jul 28, 5:40 pm, Oxide Scrubber <jharri...@hatlop.de> wrote:
>
> Clojure is kind of cool, but many corrections are in order
No, they are not.
>> fft1976 wrote:
>>> Java: 1.5x slower than C as a rule of thumb.
>> I think it can achieve parity.
>
> I disagree. I don't think the JIT can do much about the memory layout
> of the data structures. Compare a vector of complex numbers or of 3D
> vectors (NOT of pointers to them) in C/C++ and Java. Run some tests. I
> did and I looked at others'.
>
> For me, 1.5x is a good trade-off for safety though.
The JIT can't, but the coder can. If you want a vector of N
double-precision complex numbers in Java that is contiguous in memory,
for example, you could use a Java array of 2xN doubles and index into it
appropriately.
This won't work with encapsulated-object bignums, but at that point
you're probably spending most of your time in individual bignum ops,
particularly multiplies, anyway, so traversal from one bignum to another
becomes an insignificant factor in run-time.
>> With Java, in most cases you can slap "implements Cloneable" on a
>> class and make the clone method public,
>
> Java's "clone" does a shallow copy only (check the docs).
True. If you want a deep copy you will have to implement it yourself. Or
you can make a deepCopy static utility method that exploits
"Serializable" to deep copy anything that's serializable simply by
serializing and deserializing it (which can use memory, or a temp file,
and not much memory if you make an auxiliary class implement both
InputStream and OutputStream, with its OutputStream methods writing to a
growable buffer and its InputStream methods consuming (possibly blocking
if necessary) from same. Closing the OutputStream aspect EOFs the
InputStream aspect. Then wrap in ObjectInput/OutputStream. You can use a
BlockingQueue of byte arrays of length 8192 (or whatever), serialize to
one end and deserialize from the other in concurrent threads, and it
will tend to not use much memory. Limit the BlockingQueue length to 1
item and it will never use much more than 8Kbyte (the OutputStream
aspect will block until the InputStream aspect consumes from the queue).
>> or slap "implements
>> Serializable" on a class to make its instances marshallable.
>
> Does this handle cycles and memory sharing among data structures?
It does.
>> (This doesn't, however,
>> interoperate with generic Java objects or Java serialization, and I'm
>> not sure it works with data structures with circularities. It won't work
>> with data structures with infinite sequences in them, but if you
>> represent such sequences symbolically it can.)
>
> But you'll need Java's data structures and mutations on Java's arrays
> to compete with it in speed of numerical code
Not necessarily. It depends on what sort of numerical code.
If the bulk of the time is spent performing arithmetic operations on
just a few values, these inner loops can be tightened up and use only
local variables, no arrays or other structures at all.
If the arithmetic is bignum, the bulk of your time will be spent
performing individual bignum operations. Algorithmic smartness
(Karatsuba multiplication, memoizing or otherwise saving multiply-used
intermediate values, and exploiting concurrency) will win big while
speeding up the loops that invoke bignum operations won't.
If the arithmetic is on smallnums in arrays and the computations are
mostly mutations, then you may want to use Java arrays, and you may want
to use a Java method instead of a Clojure function to do the operation
(and may still call this from Clojure easily enough). Note above about
Java: if you want contiguous memory you'll have to give up using Java
objects for things like complexes. But you can still make quasi-methods
for quasi-objects (e.g. methods that take an array and an index and
treat the two array elements starting at that index as real and
imaginary parts of a complex numbers and perform a complex op on them).
With Clojure code, you can make macros that expand to complex operations
on adjacent pairs of values in a Java primitive array. In practice,
Clojure access to Java arrays, even primitive arrays, seems to be slow.
This may be addressed in a future version. Alternatively, use Java for
this. Macros can also be used to turn code that operates on notional
vector-like data structures of lengths known at compile time into code
that actually operates on large sequences of local variables. The
"vectors" should then end up as contiguous data on the *stack*. If the
lengths are not known until run-time, the same macros can be used along
with "eval" to compile functions on the fly to perform efficient
operations on them. In fact, if other aspects of the computations are
also not known until run-time "eval" can be useful. If at compile time,
for example, an unknown value will be added to the diagonal entries of
lots of 1000x1000 matrices, and at run time that value is pure real, at
run time "eval" can emit in this case specialized code that doesn't
waste time adding thousands of zeros to imaginary parts of matrix entries.
Last but certainly not least, ask if any such algorithms can be
rewritten to be based less on mutation and more on map-reduce type
operations.
>> Clojure has strong support for parallelism and threading.
>
> Clojure's support for multithreading is good only as long as your code
> is pure-functional. Let's see you add 1.0 to all diagonal elements of
> a 1000x1000 matrix.
Clojure has all of Java's support for multithreading too. You could on a
dual-core machine get two threads each mutating 500 of those diagonal
entries -- no locking required since the changes are independent of one
another. Just as you could in Java. Or do it in Java and call this from
Clojure.
>> You need to work a bit to get the most speed out of Clojure too, but you
>> can then get C-like performance out of it in tight loops.
>
> In theory, imperative and Java array using Clojure can be made as fast
> as Java (which is slower than C)
See above: not if you lay out your data right, and in Clojure (unlike
pure Java) you can use macros or similarly to emulate having object
operations on the data despite it really being in a flat array.
> Aside: do you remember to add -O3 when you are compiling C/C++? I use
> "-server" when running the JVM.
I am assuming both. Without -server, Clojure and Java will be
significantly slower than C/C++. With -server, I've seen numerical
calculations in both run at tuned-assembly speeds.
== 4 of 4 ==
Date: Tues, Jul 28 2009 10:55 pm
From: fft1976
On Jul 28, 9:46 pm, Oxide Scrubber <jharri...@hatlop.de> wrote:
> >> fft1976 wrote:
> >>> Java: 1.5x slower than C as a rule of thumb.
> >> I think it can achieve parity.
>
> > I disagree. I don't think the JIT can do much about the memory layout
> > of the data structures. Compare a vector of complex numbers or of 3D
> > vectors (NOT of pointers to them) in C/C++ and Java. Run some tests. I
> > did and I looked at others'.
>
> > For me, 1.5x is a good trade-off for safety though.
>
> The JIT can't, but the coder can. If you want a vector of N
> double-precision complex numbers in Java that is contiguous in memory,
> for example, you could use a Java array of 2xN doubles and index into it
> appropriately.
This is fanboy fantasy, not reality. If I have a library for dealing
with 3D vectors, I'm not going to lay out my data in flat arrays and
copy the vectors back and forth. Also, this trick won't work with non-
homogeneous records.
> >> With Java, in most cases you can slap "implements Cloneable" on a
> >> class and make the clone method public,
>
> > Java's "clone" does a shallow copy only (check the docs).
>
> True. If you want a deep copy you will have to implement it yourself.
That's what I wrote. What was the point of your comment?
> Or
> you can make a deepCopy static utility method that exploits
> "Serializable" to deep copy anything that's serializable simply by
> serializing and deserializing it (which can use memory, or a temp file,
> and not much memory if you make an auxiliary class implement both
> InputStream and OutputStream, with its OutputStream methods writing to a
> growable buffer and its InputStream methods consuming (possibly blocking
> if necessary) from same. Closing the OutputStream aspect EOFs the
> InputStream aspect. Then wrap in ObjectInput/OutputStream. You can use a
> BlockingQueue of byte arrays of length 8192 (or whatever), serialize to
> one end and deserialize from the other in concurrent threads, and it
> will tend to not use much memory. Limit the BlockingQueue length to 1
> item and it will never use much more than 8Kbyte (the OutputStream
> aspect will block until the InputStream aspect consumes from the queue).
Ouch...
> If the bulk of the time is spent performing arithmetic operations on
> just a few values,
We are talking number crunching here, not useless pissing contests,
like calculating the digits of Pi.
> If the arithmetic is bignum, the bulk of your time will be spent
> performing individual bignum operations.
Contrary to what the term sounds like, number crunching is rarely
about bignums.
> If the arithmetic is on smallnums in arrays and the computations are
> mostly mutations, then you may want to use Java arrays,
That's what I said.
> In practice,
> Clojure access to Java arrays, even primitive arrays, seems to
> be slow. This may be addressed in a future version.
Yeah, yeah...
I noticed that you decided to delete this, by the way:
In practice, experts seem to
agree that Clojure is 5-10 times slower than Java:
http://groups.google.com/group/clojure/msg/92b33476c0507478
(relevant follow-up set)
==============================================================================
TOPIC: A silly belief shattered (happily)
http://groups.google.com/group/comp.lang.c++/t/34c9bf7361966608?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Jul 28 2009 6:47 pm
From: Puppet_Sock
On Jul 28, 4:35 am, "Alf P. Steinbach" <al...@start.no> wrote:
[snip]
> No, I'm saying that because the space is allowed one can easily let macros
> produce other macro invocations, where the name of the macro to be invoked is a
> parameter (otherwise, token-pasting via ## doesn't produce a valid token).
Um. If I was in a code review, and I found such
a thing, I'd flag it as a code fault even if it
did "work."
> I've not done much macro stuff (obviously!).
This is a *good* thing.
> But now I need some facility to simplify some notation, and I'm amazed at what's
> possible using just the primitive C and C++ preprocessor.
I think there are better ways to simplify notation
than using macros the way you describe.
Indeed, I'm not real sure I'd say that this scheme
is aptly described as "simplifying" notation.
Socks
== 2 of 2 ==
Date: Tues, Jul 28 2009 7:24 pm
From: "Alf P. Steinbach"
* Puppet_Sock:
> On Jul 28, 4:35 am, "Alf P. Steinbach" <al...@start.no> wrote:
> [snip]
>> No, I'm saying that because the space is allowed one can easily let macros
>> produce other macro invocations, where the name of the macro to be invoked is a
>> parameter (otherwise, token-pasting via ## doesn't produce a valid token).
>
> Um. If I was in a code review, and I found such
> a thing, I'd flag it as a code fault even if it
> did "work."
You'd have to flag the Boost Preprocessor library as a "code fault", then. ;-)
So as a general statement it makes no sense, but it depends on the context.
For example, in a sweatshop-like workplace it can make sense to impose literal
rules, because the grunt workers are just robots, or would be if such existed.
In other contexts the programmer's job is to apply intelligence and aesthetics,
something that robots following mechanical code-production rules would find
difficult or impossible to do. The application of intelligence and aestethics
can't be judged by literal rules, or rather, should ideally not be so judged,
for doing that will in most cases lower quality instead of raising it (the few
cases where it might raise quality being those where the rules are
coincidentally "right" *and* the programmer had a lapse of judgment).
>> I've not done much macro stuff (obviously!).
>
> This is a *good* thing.
:-)
I think I agree.
>> But now I need some facility to simplify some notation, and I'm amazed at what's
>> possible using just the primitive C and C++ preprocessor.
>
> I think there are better ways to simplify notation
> than using macros the way you describe.
>
> Indeed, I'm not real sure I'd say that this scheme
> is aptly described as "simplifying" notation.
It's good that you write you're not "real sure", since you don't know anything
about "this scheme". :-)
Cheers & hth.,
- Alf
==============================================================================
TOPIC: ◆♡◆→Wholesale Nokia ,Iphone, Samsung, Blackberry, Sony, Motorola,etc
brand mobiles "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)
http://groups.google.com/group/comp.lang.c++/t/aba034d13f4c8c8c?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 7:34 pm
From: peng Selina
◆♡◆→Wholesale Nokia http://www.toptradea.com/category.php?id=436
,Iphone http://www.toptradea.com/category.php?id=435 , Samsung
http://www.toptradea.com/category.php?id=440, Blackberry
http://www.toptradea.com/category.php?id=437, HTC
http://www.toptradea.com/category.php?id=438, Motorola
http://www.toptradea.com/category.php?id=439,etc brand mobiles
"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)
Iphone http://www.toptradea.com/category.php?id=435
Nokia http://www.toptradea.com/category.php?id=436
Blackberry http://www.toptradea.com/category.php?id=437
HTC http://www.toptradea.com/category.php?id=438
Samsung http://www.toptradea.com/category.php?id=440
Motorola http://www.toptradea.com/category.php?id=439
==============================================================================
TOPIC: ♡◆♡Sneaker of Nike,Jordan,Gucci,Adidas,Puma,EdhardyShox,Max,Free,Rift%
Polo,Lacoste,BBC,Gucci,Armani,LV,Christina Audigier Tshirt and Jeans ♡www.
toptradea.com♡ The best supplier
http://groups.google.com/group/comp.lang.c++/t/149654c7d9179c99?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 7:37 pm
From: peng Selina
♡◆♡Sneaker of Nike,Jordan,Gucci,Adidas,Puma,EdhardyShox,Max,Free,Rift
%Polo,Lacoste,BBC,Gucci,Armani,LV,Christina Audigier Tshirt and Jeans
♡www.toptradea.com♡ The best supplier
Nike Air Jordan http://www.toptradea.com/category.php?id=6,
Air Jordan Fusion http://www.toptradea.com/category.php?id=7,
Nike Air Max http://www.toptradea.com/category.php?id=8,
Nike Shox http://www.toptradea.com/category.php?id=9,
Air Force 1 http://www.toptradea.com/category.php?id=14,
Nike Rift http://www.toptradea.com/category.php?id=10,
Adidas http://www.toptradea.com/category.php?id=11,
Puma http://www.toptradea.com/category.php?id=12,
Nike Blazer http://www.toptradea.com/category.php?id=20,
Ed hardy http://www.toptradea.com/category.php?id=15,
Gucci http://www.toptradea.com/category.php?id=13
Lacoste http://www.toptradea.com/category.php?id=16
T-shirt: Bape http://www.toptradea.com/category.php?id=282,
Christina Audigier http://www.toptradea.com/category.php?id=285
,
D&G http://www.toptradea.com/category.php?id=290 ,
Ed hardy http://www.toptradea.com/category.php?id=292 ,
BBC http://www.toptradea.com/category.php?id=405 ,
Burberry http://www.toptradea.com/category.php?id=407 ,
G-star http://www.toptradea.com/category.php?id=408 ,
Gucci http://www.toptradea.com/category.php?id=411 ,
Lacoste http://www.toptradea.com/category.php?id=417 ,
Polo http://www.toptradea.com/category.php?id=423 ,
LV http://www.toptradea.com/category.php?id=422 ,
Smet http://www.toptradea.com/category.php?id=430 ,
Affliction http://www.toptradea.com/category.php?id=174 ,
Armani http://www.toptradea.com/category.php?id=180
Jeans: Evisu http://www.toptradea.com/category.php?id=363 ,
Gucci http://www.toptradea.com/category.php?id=365 ,
G-star http://www.toptradea.com/category.php?id=364 ,
LV http://www.toptradea.com/category.php?id=382 ,
D&G http://www.toptradea.com/category.php?id=192 ,
Ed hardy http://www.toptradea.com/category.php?id=186 ,
Iceberg http://www.toptradea.com/category.php?id=379 ,
BBC http://www.toptradea.com/category.php?id=191 ,
RMC http://www.toptradea.com/category.php?id=369 ,
Coogi http://www.toptradea.com/category.php?id=380,
Prada http://www.toptradea.com/category.php?id=193
==============================================================================
TOPIC: ☆═━┈Hot sale Fashion Lady Handbags Juicy,Burberry,Gucci,LV,Prada,D&G,
Edhardy,Chanel,Coach, Jimmy-Hoo ♡www.toptradea.com♡
http://groups.google.com/group/comp.lang.c++/t/cd952fac818b82ff?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 7:39 pm
From: peng Selina
☆═━┈Hot sale Fashion Lady Handbags
Juicy,Burberry,Gucci,LV,Prada,D&G,Edhardy,Chanel,Coach, Jimmy-Hoo
♡www.toptradea.com♡
Handbags http://www.toptradea.com/category.php?id=66
Prada Handbags http://www.toptradea.com/category.php?id=395
LV Handbags http://www.toptradea.com/category.php?id=394
Juicy Handbags http://www.toptradea.com/category.php?id=393
Jordan Handbags http://www.toptradea.com/category.php?id=392
Jimmy Hoo Handbags http://www.toptradea.com/category.php?id=391
Ed hardy Handbags http://www.toptradea.com/category.php?id=390
Fendi Handbags http://www.toptradea.com/category.php?id=389
DB Handbags http://www.toptradea.com/category.php?id=388
Coach Handbags http://www.toptradea.com/category.php?id=387
Chloe Handbags http://www.toptradea.com/category.php?id=386
Burberrys Handbags http://www.toptradea.com/category.php?id=385
Gucci Handbags http://www.toptradea.com/category.php?id=183
Chanel Handbags http://www.toptradea.com/category.php?id=185
D&G Handbags http://www.toptradea.com/category.php?id=184
Brand-Luggages http://www.toptradea.com/category.php?id=384
==============================================================================
TOPIC: how to specify overloaded function
http://groups.google.com/group/comp.lang.c++/t/26ad21b74db02ab6?hl=en
==============================================================================
== 1 of 3 ==
Date: Tues, Jul 28 2009 8:45 pm
From: "Amadeus W.M."
I wan to do this:
#include <algorithm>
//
std::transform(Xj.begin(), Xj.end(), logXj.begin(), std::log);
//
where Xj and logXj are of type
class Foo
{
public:
typedef double * iterator;
typedef const double * const_iterator;
//
};
The compiler understandably gets confused by std::log, with the following
error:
fooMain.C:131: error: no matching function for call to 'transform(double*,
double*, double*, <unresolved overloaded function type>)'
make: *** [main] Error 1
How do I specify that I want
double log(double) ?
Thanks!
== 2 of 3 ==
Date: Tues, Jul 28 2009 9:29 pm
From: Mohammad Nabil Al-Aggan
On Jul 29, 6:45 am, "Amadeus W.M." <amadeu...@verizon.net> wrote:
> I wan to do this:
>
> #include <algorithm>
>
> //
> std::transform(Xj.begin(), Xj.end(), logXj.begin(), std::log);
> //
>
> where Xj and logXj are of type
>
> class Foo
> {
> public:
> typedef double * iterator;
> typedef const double * const_iterator;
>
> //
>
> };
>
> The compiler understandably gets confused by std::log, with the following
> error:
>
> fooMain.C:131: error: no matching function for call to 'transform(double*,
> double*, double*, <unresolved overloaded function type>)'
> make: *** [main] Error 1
>
> How do I specify that I want
>
> double log(double) ?
>
> Thanks!
Just add a cast to the overloaded type you desire:
#include <algorithm>
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
vector<double> x;
x.push_back(10);
std::transform(x.begin(),x.end(),x.begin(),(double (*)(double))
std::log);
cout << *x.begin();
}
// Prints: 2.30259
== 3 of 3 ==
Date: Tues, Jul 28 2009 10:50 pm
From: Ian Collins
Amadeus W.M. wrote:
> I wan to do this:
>
> #include <algorithm>
>
> //
> std::transform(Xj.begin(), Xj.end(), logXj.begin(), std::log);
> //
>
> How do I specify that I want
>
> double log(double) ?
>
The problem is probably cased by std::log having the wrong linkage
(extern "C" for use in the C world).
Either use a wrapper, or a cast.
--
Ian Collins
==============================================================================
TOPIC: Behaviour of istream_iterator on closed stream
http://groups.google.com/group/comp.lang.c++/t/b2854b7eb7f63001?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 10:54 pm
From: Old Wolf
Code snippet:
std::ifstream file( "does_not_exist" );
std::vector<char> file_vec;
std::copy( std::istream_iterator<char>(file),
std::istream_iterator<char>(), std::back_inserter(file_vec) );
if ( file_vec.empty() )
// file did not exist or had no contents..
I expected this to work, and have the istream_iterator for
closed file return a blank iterator, so the copy would not
copy anything. But it segfaults. Is the behaviour
undefined or is my compiler broken?
==============================================================================
TOPIC: How can I use unqualified names? (Possibly hard or impossible?)
http://groups.google.com/group/comp.lang.c++/t/e2f24a95fe72b591?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 11:27 pm
From: "Alf P. Steinbach"
* James Kanze:
> On Jul 26, 10:35 pm, "Alf P. Steinbach" <al...@start.no> wrote:
>> * James Kanze:
>
>>> As for maintenance: the input file for my AWK script looks
>>> something like:
>
>>> x double 3.14159
>>> y int 42
>>> # ...
>
>>> It's hard for me to imagine anything easier to maintain---to add
>>> a new attribute, it's one line. (In the form I actually use,
>>> the AWK script is about twice as long, and the input has the
>>> form:
>
>>> [Option] # the class name...
>>> x double 3.14159
>>> y int 42
>>> # ...
>
>>> The results are two files, Option.hh and Option.cc.)
>
>> With C++ you add one line and modify the line that defines the
>> class, e.g., with JK as James Kanze macro prefix:
>
>> JK_DEF_OPT( x, 3.14159 )
>> JK_DEF_OPT( y, int, 42 )
>> JK_DEF_OPT_CLS_2( Option, nobase, x, y )
>
>> The result is generated code at the point of those macro
>> invocations, no extra files to care about and manage, no
>> generated files to remember to not modify.
>
> You're still mentionning x and y twice:-). So you have to
> insert one line, and modify another; in my version (both macros
> and AWK), you just insert a single line.
I thought about it and I think you're right. Especially with respect to later
switching over to some other option class generator it's better to just have a
single macro. So I created wrapper macros, so that I now write e.g.
CPPX_DEFINE_2OPTIONCLASS(
Params, Base::Params,
is3State, bool, false,
isAuto, bool, true
)
> Anyway: I'm supposing that the _2 in the last line specifies the
> number of attributes. IMHO, that's error prone, but get rid of
> that, and I think I could buy it.
I don't think one can get rid of that number without variadic macros, which are
currently non-standard, or perhaps Boost-like macro magic, which is
incomprehensible, counter-intuitive and probably would require supporing macro
definitions around each usage, making the notation more awkward.
I think the number, writing "2" or "3" or whatever, is very low cost.
If you use the wrong number you just get compilation error.
Cheers,
- Alf
==============================================================================
TOPIC: Ed hardy handbags Discount
http://groups.google.com/group/comp.lang.c++/t/f1e9dda3ad42edee?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Jul 28 2009 11:38 pm
From: gosee
Find Designer Ed hardy bags and Ed hardy handbags with cheap price ?
We offer kinds of styles Designer Ed hardy bags & Ed hardy
handbags,they all fine quality and cheap price for choose.
You can check them here:
http://www.showluxury.com/goods.php?id=730
Our pricing will match wholesale rates and you do not have to buy
wholesale,
you can pick your favorite Ed hardy bags in retail and pay wholesale
price.
==============================================================================
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
No comments:
Post a Comment