http://groups.google.com/group/comp.lang.c++?hl=en
comp.lang.c++@googlegroups.com
Today's topics:
* 。◕‿◕。 2010 Cheap price wholesale Affliction Jean, Bape Jean, G-star Jean,
Evisu Jean at www.fjrjtrade.com <Paypal Payment> - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/d2817deb6e12ca1b?hl=en
* ✲⊙✲⊙✲nike shox | nike shox r4 | nike shox r5 | nike shox r3 | nike shox in
www.ecyaya.com - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/391a41dea149d1b1?hl=en
* Another strange linux kernel change - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/e05a4158a9750a03?hl=en
* ISO C++ forbids assignment of arrays - is there a way out ? - 2 messages, 2
authors
http://groups.google.com/group/comp.lang.c++/t/3653ac60c7f02d4a?hl=en
* Avoiding pointers to member functions - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/91122aae5ea3693a?hl=en
* Free shipping wholesale Air Force One,Air Jordans1-23, Jordan2.2,Jordan2.5,3.
5,4.5, 6.5,7.5,13.5,15.5,21.5. (www.vipchinatrade.com) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/ea737ec094e6a313?hl=en
* Initialize std::vector<T>::iterator with arbitrary element? - 3 messages, 3
authors
http://groups.google.com/group/comp.lang.c++/t/8c764c4dcde8b09e?hl=en
* scientific publications on the "Square-rectangle problem"? - 8 messages, 6
authors
http://groups.google.com/group/comp.lang.c++/t/17378f3e6e3294ba?hl=en
* Looking for C++ IDE,... - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/e8a1db0949215858?hl=en
* Safe to use substr? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/cece8bdad80abdbe?hl=en
* ❤~❤~❤ cheap wholesale UGG shoes at www.fjrjtrade.com (paypal payment) - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/546ec6d2636da544?hl=en
* struct containing vector? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/d0ba6cd9c3737991?hl=en
==============================================================================
TOPIC: 。◕‿◕。 2010 Cheap price wholesale Affliction Jean, Bape Jean, G-star
Jean, Evisu Jean at www.fjrjtrade.com <Paypal Payment>
http://groups.google.com/group/comp.lang.c++/t/d2817deb6e12ca1b?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 12:10 am
From: "www.fjrjtrade.com"
。◕‿◕。 2010 Cheap price wholesale Affliction Jean, Bape Jean, G-star
Jean, Evisu Jean at www.fjrjtrade.com <Paypal Payment>
Cheap Wholesale Jeans www.fjrjtrade.com
Cheap Wholesale Jeans www.fjrjtrade.com
Cheap Wholesale Jeans www.fjrjtrade.com
╃Men Size 30,32,34,36,38,40 Women Size 26,27,28,29,30,31 Cheap
Wholesale Jean
Cheap wholesale ZEN Jean, Laguna Beach Jean, Artful Dodger Jean, BBC
Jean, Cavalli Jean, Prada Jean, RMC Jean, Roca Wear Jean, Affliction
Jean, Akademiks Jean, Armani Jean, Bape Jean, Black Label Jean,
Christian Audigier Jean, Coogi Jean, Crown Holder Jean, D&G Jean,
Diesel Jean, Ecko Unltd Jean, Ed Hardy Jean, Evisu Jean, G-Star Jean,
Gucci Jean, Iceberg Jean, Jack&Jones Jean, Justcavalli Jean, Kanji
Jean, LEVI'S Jean, LRG Jean, LV Jean, Rock Jean, True Relig Jean,
Versace Jean ect
http://www.fjrjtrade.com/1261-Jean.html
Cheap wholesale Affliction Jean (paypal payment)
http://www.fjrjtrade.com/1262-Affliction-Jean.html
Cheap wholesale Bape Jean (paypal payment)
http://www.fjrjtrade.com/1265-Bape-Jean.html
Cheap wholesale G-Star Jean (paypal payment)
http://www.fjrjtrade.com/1275-G-Star-Jean.html
Cheap wholesale Evisu Jean (paypal payment)
http://www.fjrjtrade.com/1274-Evisu-Jean.html
Wholesale more others Jeans at Website:
http://www.fjrjtrade.com
==============================================================================
TOPIC: ✲⊙✲⊙✲nike shox | nike shox r4 | nike shox r5 | nike shox r3 | nike shox
in www.ecyaya.com
http://groups.google.com/group/comp.lang.c++/t/391a41dea149d1b1?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 1 2010 12:25 am
From: hero
✲⊙✲⊙✲nike shox | nike shox r4 | nike shox r5 | nike shox r3 | nike
shox in www.ecyaya.com
from china cheap wholesale
Nike released a new athletic Nike Shox shoe - the R3, as part of the
shox family this stylish shoe is sure to be very popular among the
athletes and others who love the latest in style and fashion. R3
delivers with extra padding built into the heel for athletic
purposes,
and practical reasons. And now a large variety of stlyes and colours
of R3 are in stock at our website- www.ecyaya.com.
Product descriptio The nike shox rival asics running shoes have the
following features: top plate distributes impact forces from the heel
to the columns; bottom plate produces a secure base for heel-to-toe
transition; transition wedge allows for a smooth ride. Its been
called
a lot of things: springy, resilient, bouncy. But to a runner, the
Nike
Shox R3 means one thing: responsive cushioning. The top plate
distributes impact forces from the heel to the individual columns,
deflecting like a trampoline. The bottom plate supports the columns,
producing a secure base to guide your foot through the heel-to-toe
transition. The columns control impact by collapsing quickly at
first,
and then slowly returning to their original height. The transition
wedge allows for a smooth ride from the Nike Shox cushioning system
in
the heel to the Air-Sole unit found in the forefoot. Nike Shox
technology, a revolution in cushioning and impact protection,
provides
an optimal environment for cushioning, a slower rate of impact
loading
(which helps reduce the risk of impact-related injuries), and a
uniquely responsive feel. The highly resilient foam in Nike Shox
columns is made of energy-efficient material that enhances durability
and spring. It?s great and comfortable using for running and walking,
Please see the pictures for more details. They are the model in the
picture
Here is the Nike Shox R4 kids, you can feel the best in the R4 shoes,
and its responsive cushioning provides you with a great ride. It has
synthetic upper for support and phylon midsole with Air-sole unit. R4
has the original Nike Shox technology in the heel and BRS1000 carbon
rubber outsole for durability- www.ecyaya.com
== 2 of 2 ==
Date: Mon, Feb 1 2010 12:25 am
From: hero
✲⊙✲⊙✲nike shox | nike shox r4 | nike shox r5 | nike shox r3 | nike
shox in www.ecyaya.com
from china cheap wholesale
Nike released a new athletic Nike Shox shoe - the R3, as part of the
shox family this stylish shoe is sure to be very popular among the
athletes and others who love the latest in style and fashion. R3
delivers with extra padding built into the heel for athletic
purposes,
and practical reasons. And now a large variety of stlyes and colours
of R3 are in stock at our website- www.ecyaya.com.
Product descriptio The nike shox rival asics running shoes have the
following features: top plate distributes impact forces from the heel
to the columns; bottom plate produces a secure base for heel-to-toe
transition; transition wedge allows for a smooth ride. Its been
called
a lot of things: springy, resilient, bouncy. But to a runner, the
Nike
Shox R3 means one thing: responsive cushioning. The top plate
distributes impact forces from the heel to the individual columns,
deflecting like a trampoline. The bottom plate supports the columns,
producing a secure base to guide your foot through the heel-to-toe
transition. The columns control impact by collapsing quickly at
first,
and then slowly returning to their original height. The transition
wedge allows for a smooth ride from the Nike Shox cushioning system
in
the heel to the Air-Sole unit found in the forefoot. Nike Shox
technology, a revolution in cushioning and impact protection,
provides
an optimal environment for cushioning, a slower rate of impact
loading
(which helps reduce the risk of impact-related injuries), and a
uniquely responsive feel. The highly resilient foam in Nike Shox
columns is made of energy-efficient material that enhances durability
and spring. It?s great and comfortable using for running and walking,
Please see the pictures for more details. They are the model in the
picture
Here is the Nike Shox R4 kids, you can feel the best in the R4 shoes,
and its responsive cushioning provides you with a great ride. It has
synthetic upper for support and phylon midsole with Air-sole unit. R4
has the original Nike Shox technology in the heel and BRS1000 carbon
rubber outsole for durability- www.ecyaya.com
==============================================================================
TOPIC: Another strange linux kernel change
http://groups.google.com/group/comp.lang.c++/t/e05a4158a9750a03?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 12:45 am
From: "Man-wai Chang to The Door (24000bps)"
> Ummmm... if your idea of quality control is that anything that doesn't
> immediately crash your kernel can't be too bad, then please don't
> submit any code.... ;-P. - Tony
Not if that programmer did something wrong in the very beginning! :)
--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (x86_64 Ubuntu 9.10) Linux 2.6.32.7
^ ^ 16:45:01 up 2 days 51 min 1 user load average: 1.05 1.09 1.08
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
==============================================================================
TOPIC: ISO C++ forbids assignment of arrays - is there a way out ?
http://groups.google.com/group/comp.lang.c++/t/3653ac60c7f02d4a?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 1 2010 12:46 am
From: tonydee
On Feb 1, 4:54 pm, Xavier Roche <xro...@free.fr.NOSPAM.invalid> wrote:
> class B {
> public:
> B();
>
> protected:
> A a;
>
> private:
> char progName[4]; // dummy
> int argc;
> char *argv[2];
>
> }
>
> B::B(): progName("foo"),
> argc(1),
> argv({progName, NULL}),
> a(argc, argv)
> { }
>
> Is there a way out, or do I have to give up and use a pointer to A as
> member, with proper "manual" new construct ?
Data members are initialised in the order in which they are added to
the class - not necessarily the same order given in the initialiser
list (GNU gcc -Wall will warn). So, put "a" after the other data
members you wish you pass to a's constructor.
Then, one scrappy but easy way to do this is to use the comma operator
to evaluate some expressions, throwing away their values but
preserving their side effects:
struct B
{
B()
: a(((argv[0] = "one"), (argv[1] = "two"), (argv[2] = 0), argv))
{ }
const char* argv[2];
A a;
};
Cheers,
Tony
== 2 of 2 ==
Date: Mon, Feb 1 2010 7:11 am
From: Tony D
On Feb 1, 5:46 pm, tonydee <tony_in_da...@yahoo.co.uk> wrote:
> struct B
> {
> B()
> : a(((argv[0] = "one"), (argv[1] = "two"), (argv[2] = 0), argv))
> { }
>
> const char* argv[2];
> A a;
> };
Hmmm... teach me to try to make the solution a little more interesting
by including an extra array element... argv[3] would work better.
Cheers, Tony
==============================================================================
TOPIC: Avoiding pointers to member functions
http://groups.google.com/group/comp.lang.c++/t/91122aae5ea3693a?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 1 2010 1:08 am
From: tonydee
On Jan 31, 9:31 am, "BGB / cr88192" <cr88...@hotmail.com> wrote:
> "Robert Fendt" <rob...@fendt.net> wrote in message
>
> news:20100131002313.6cc96dc6@vulcan.local...
>
>
>
> > And thus spake "BGB / cr88192" <cr88...@hotmail.com>
> > Sat, 30 Jan 2010 13:37:18 -0700:
>
> >> 1, is the most direct and also gives the best performance FWIW.
>
> >> anyways, the syntax is not THAT horrible, and really, if it does seem
> >> that
> >> bad, one can always "typedef" the function-pointer, making it look about
> >> like a normal field...
>
> >> anyways, the syntax for normal function pointers is still far less ugly
> >> than
> >> when one is passing or returning function pointers... (maybe stop for a
> >> second to imagine the declaration of a function accepting a function
> >> pointer
> >> and returning another function pointer...).
>
> > Yes, passing function pointers around is where the nasty really starts.
> > Just switching stored pointers is something akin to virtual functions, in
> > a way (just not as flexible, but more light-weight). You are right, one
> > can use them at least in a semi-clean way, so I think I will stick with
> > them.
>
> yep.
>
> >> there is always the option of using object fields and switch statements
> >> (to
> >> re-dispatch to other methods), which has both good and bad points...
>
> > The switch statement pattern is of course always an option. But before I
> > do that, I think I will stick with the member function pointer. It is a
> > little bit faster _and_ more readable; performance really is an issue at
> > that point, since the function in question will be run as part of an image
> > transformation loop. So yes, I am willing to sacrifice a bit of
> > cleanliness in the design if it yields significant speed advantages. But
> > using switches does not look very beneficial from both the performance and
> > the design points of view.
>
> yes, agreed...
>
> I guess some people though really like the switches though, and I guess they
> do a little better in cases where there are a number of possible states, but
> little liklihood of dynamically adding any new states.
Actually, it's the switch/case statement that should be faster. For
calling functions with small implementations, switch statements
outperform function pointers / virtual dispatch because the optimiser
can inline the implementation and allocate registers in accord with
the cases in the switch, avoiding the more general register saving and
stack frame adjustments associated with function calls. But, profile
it and see....
Also, for performance-sensitive image processing code, you're almost
certainly much better off having a run-time switch on the outside of
the loop, then reinstantiating a template for the specific loop/
operations, gaining the benefits of full compile-time inlining and
optimisation for each operation.
Cheers,
Tony
== 2 of 2 ==
Date: Mon, Feb 1 2010 8:56 am
From: Chris Ahlstrom
James Kanze pulled this Usenet boner:
> On Jan 30, 7:00 pm, Robert Fendt <rob...@fendt.net> wrote:
>
>> I am trying to find the best way to make part of a class's
>> behaviour configurable during runtime, yet with as little
>> overhead as possible. Maybe someone here has an idea? So far I
>> have come up with 3 alternatives, all of which I do not really
>> like for different reasons.
>
>> (1) The 'simple' solution would be to implement various
>> alternatives of the (private) member function in question, and
>> use a "pointer to member function" to access it.
>
> But the real arguments against them are those you raised, along
> with the fact that you cannot associate data with them.
Is it worth using boost::bind to associate data with a function
pointer? And would also apply to function objects.
And for keeping the binding around, boost::function.
Disclaimer: I'm still early in my "exploration" of these Boost helpers.
--
He that is giddy thinks the world turns round.
-- William Shakespeare, "The Taming of the Shrew"
==============================================================================
TOPIC: Free shipping wholesale Air Force One,Air Jordans1-23, Jordan2.2,Jordan
2.5,3.5,4.5, 6.5,7.5,13.5,15.5,21.5. (www.vipchinatrade.com)
http://groups.google.com/group/comp.lang.c++/t/ea737ec094e6a313?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 1:39 am
From: yoyo
Minimum order is one,factory price also! Paypal payment free
shipping,ship time will take 4-7 working days.
Cheap Wholesale Jordan 1 (paypal payment)(www.vipchinatrade.com )
Cheap Wholesale Jordan 1.5 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 2 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 2.5 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 3 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 3.5 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 4 (paypal payment)(www.vipchinatrade.com )
Cheap Wholesale Jordan 4.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 5 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 5.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 6 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 6.5 Kid (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 7 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 7.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 8 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 9 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 9.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 10 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 11 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 11.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 12 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 12.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 13 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 14 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 15 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 15.5 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 16 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 17 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 18 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 19 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 19.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 22 Man (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 22.5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 23 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 24 (paypal payment)(www.vipchinatrade.com )
Cheap Wholesale Air Yeezy (free shipping www.vipchinatrade.com)
Cheap Wholesale Jodan 23+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 1+Jordan 2+Jordan 5+Jordan 7
Cheap Wholesale Jordan 3+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 3+Jordan 5+Jordan 15 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 4+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 4.5+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 5+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 6+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 9+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 9+Jordan 23 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 11+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 11.5+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 11+Anthony (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 11+Jordan 12 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 11+Jordan 13 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 11+Jordan 23 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 11+Obama (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 12+AF1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 13+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 13+AJ6Rings (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 16.5+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 18+Jordan 23 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 20+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 21+Jordan 23 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 25+AF1 (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan 6 unite1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan 8 unite1 (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan flying (paypal payment)
(www.vipchinatrade.com )
Cheap Wholesale Jordan foamposite liite Man (free shipping
www.vipchinatrade.com)
Cheap Wholesale Jordan Melo M5 Man (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan True Flight (free shipping www.vipchinatrade.com)
Cheap Wholesale Jordan Trunner Q4 (free shipping www.vipchinatrade.com)
==============================================================================
TOPIC: Initialize std::vector<T>::iterator with arbitrary element?
http://groups.google.com/group/comp.lang.c++/t/8c764c4dcde8b09e?hl=en
==============================================================================
== 1 of 3 ==
Date: Mon, Feb 1 2010 2:50 am
From: Rune Allnor
Hi all.
Suppose I have a vector v,
std::vector<T> v;
and corresponding iterator i
std::vector<T>::iterator i;
Now I want to initalize i to point to some
arbitrary element v[n] in the vector.
What is the best practice way to do this
initialization? I have only seen initalizations
to either v.begin() or v.end().
One naive idea - which even compiles - is
i = v.begin() + n;
However, table 7.6 in Josuttis' "The C++ Standard Library"
indicates there should be a way to index reative to
the iterator, something like
std::vector<T>::iterator j=i[n];
If correct, I would expect that something like
i = (v.begin())[n];
also would work. Which it doesn't. So did I
misunderstand something?
Rune
== 2 of 3 ==
Date: Mon, Feb 1 2010 3:03 am
From: Vladimir Jovic
Rune Allnor wrote:
> Hi all.
>
> Suppose I have a vector v,
>
> std::vector<T> v;
>
> and corresponding iterator i
>
> std::vector<T>::iterator i;
>
> Now I want to initalize i to point to some
> arbitrary element v[n] in the vector.
>
> What is the best practice way to do this
> initialization? I have only seen initalizations
> to either v.begin() or v.end().
>
> One naive idea - which even compiles - is
>
> i = v.begin() + n;
>
> However, table 7.6 in Josuttis' "The C++ Standard Library"
> indicates there should be a way to index reative to
> the iterator, something like
>
> std::vector<T>::iterator j=i[n];
>
> If correct, I would expect that something like
>
> i = (v.begin())[n];
>
> also would work. Which it doesn't. So did I
> misunderstand something?
Yes, read here :
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
== 3 of 3 ==
Date: Mon, Feb 1 2010 6:33 am
From: Richard Herring
In message
<dae03e12-31c3-4336-a576-6d31990d3ff7@e37g2000yqn.googlegroups.com>,
Rune Allnor <allnor@tele.ntnu.no> writes
>Hi all.
>
>Suppose I have a vector v,
>
> std::vector<T> v;
>
>and corresponding iterator i
>
> std::vector<T>::iterator i;
>
>Now I want to initalize i to point to some
>arbitrary element v[n] in the vector.
>
>What is the best practice way to do this
>initialization? I have only seen initalizations
>to either v.begin() or v.end().
>
>One naive idea - which even compiles - is
>
>i = v.begin() + n;
That's fine (and efficient) for a random-access iterator.
>
>However, table 7.6 in Josuttis' "The C++ Standard Library"
>indicates there should be a way to index reative to
>the iterator, something like
>
>std::vector<T>::iterator j=i[n];
ITYM T t = i[n];
>
>If correct, I would expect that something like
>
>i = (v.begin())[n];
>
>also would work. Which it doesn't. So did I
>misunderstand something?
A level of indirection. i[n] returns a reference to an element of the
vector, not an iterator.
--
Richard Herring
==============================================================================
TOPIC: scientific publications on the "Square-rectangle problem"?
http://groups.google.com/group/comp.lang.c++/t/17378f3e6e3294ba?hl=en
==============================================================================
== 1 of 8 ==
Date: Mon, Feb 1 2010 3:01 am
From: Leslaw Bieniasz
Hi,
Are there any scientific publications about the "square-rectangle problem"
(also known as the "circle-ellipse problem")
and its possible treatments in C++?
My search in literature databases does not reveal anything concrete.
I would appreciate pointers to relevant publications, if there are any.
Leslaw
== 2 of 8 ==
Date: Mon, Feb 1 2010 3:19 am
From: Saeed Amrollahi
On Feb 1, 2:01 pm, Leslaw Bieniasz <nbbie...@cyf-kr.edu.pl> wrote:
> Hi,
>
> Are there any scientific publications about the "square-rectangle problem"
> (also known as the "circle-ellipse problem")
> and its possible treatments in C++?
> My search in literature databases does not reveal anything concrete.
> I would appreciate pointers to relevant publications, if there are any.
>
> Leslaw
Hi
I think the following are good:
1. http://parashift.com/c++-faq-lite/proper-inheritance.html#faq-21.6,7,8,9,10,11
2. Kevlin Henney. From Mechanism to Method: Total Ellipse, C/C++
Users Journal March 2001.
http://www.curbralan.com/
Regards,
-- Saeed Amrollahi
== 3 of 8 ==
Date: Mon, Feb 1 2010 5:06 am
From: "Balog Pal"
"Leslaw Bieniasz" <nbbienia@cyf-kr.edu.pl>
> Are there any scientific publications about the "square-rectangle problem"
> (also known as the "circle-ellipse problem")
> and its possible treatments in C++?
> My search in literature databases does not reveal anything concrete.
> I would appreciate pointers to relevant publications, if there are any.
Scott Meyers wrote it as the 'All birds fly. Penguins are birds. Penguins
don't fly. Uh-oh.' problem.
== 4 of 8 ==
Date: Mon, Feb 1 2010 7:39 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
Leslaw Bieniasz <nbbienia@cyf-kr.edu.pl> writes:
>Are there any scientific publications about the
>"square-rectangle problem" (also known as the "circle-ellipse
>problem")
This has nothing to do whatsoever specifically with C++.
It has been solved by me some years ago - I don't know if
anyone else has published this solution, but I guess so:
This pseudoproblem only comes from the lack of distinction
between a /value/ and a /store/ (i.e., a typed region of storage).
Every square value is a rectangle value.
Every rectangle store is a square store.
(If you remove �value� and �store� from the sentences
above, you will get two contradicting statements.)
These four lines from above are all to be written about
this pseudo-problem. It is this shallow. It does not even
have to do with object-oriented programming, but with
programming in general as soon as typed stores are used.
Most articles on this �problem� do not make this solution clear,
yes, it seems as most authors really are not aware of it
and therefore are a �part of the problem�, not of the solution.
For another example, assume, x e {0,1} and y e {0,1,2,3}
(e = �element of�).
Then, every x is a y, that is x e {0,1,2,3} is always true.
That is,
every x-value is a y-value.
Now, assume, x* s {0,1} and y* s {0,1,2,3}
(s = �is able to store a value from the set ...�).
Then, every y* is an x*, that is y* s {0,1} is always true.
That is,
every x-store is a y-store.
Thus, the general rule is:
Whenever a value set U is a subset of a value set S, then
every U value is an S value, and every S store is a U store.
In C++, an immutable (const) object representing a square or
a rectangle is a �value� in the sense used above, while a
mutable (non-const) object able to store a square value or a
rectangle value is a �store� in the sense used above.
There is another place in C++, where it might have to
be observed (I do not know how this usually is treated in C++):
When U is a subtype of T, then vector<U> will usually /not/ be
a subtype of vector<T>. This is so, because a vector of a type
is not a value of this type, but a store for values of this type.
Citation for this publication:
Stefan Ram, On the Square-Rectangle Problem, Usenet-post
<rectangle-20100201160200@ram.dialup.fu-berlin.de>, 2010.
== 5 of 8 ==
Date: Mon, Feb 1 2010 8:21 am
From: Tony D
On Feb 2, 12:39 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
> Leslaw Bieniasz <nbbie...@cyf-kr.edu.pl> writes:
> >Are there any scientific publications about the
> >"square-rectangle problem" (also known as the "circle-ellipse
> >problem")
>
> This pseudoproblem only comes from the lack of distinction
> between a /value/ and a /store/ (i.e., a typed region of storage).
>
> Every square value is a rectangle value.
>
> Every rectangle store is a square store.
An elegant observation, but haven't you rather skipped over the
crucial elements: the expectations that come with the terminology,
what functions are appropriate in the interfaces, any inheritance
relationship, justified in terms of implications to correct design and
usage. Personally, I consider the FAQ helpful, but I haven't followed
your link to your complete publication... I'm sure if someone likes
the in-thread summary and is still in need of help of the issue,
they'll do so.
Regards,
Tony
== 6 of 8 ==
Date: Mon, Feb 1 2010 8:23 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
ram@zedat.fu-berlin.de (Stefan Ram) writes:
>It has been solved by me some years ago - I don't know if
>anyone else has published this solution, but I guess so:
I have been looking around and found:
http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
Using the terms from this article, I can define a function:
*: T -> T*
that maps a type T of values to a type T* of storage cells
for such values, and the essential assertion then becomes:
* is contravariant.
That is, using �<=� from this article:
square <= rectangle, but
rectangle* <= square*.
So, obviously, many computer scientists are aware of
contravariance - just some authors of web articles about
�the square-rectangle problem� are not.
== 7 of 8 ==
Date: Mon, Feb 1 2010 8:30 am
From: ram@zedat.fu-berlin.de (Stefan Ram)
Tony D <anthonypon@gmail.com> writes:
>what functions are appropriate in the interfaces, any inheritance
>relationship, justified in terms of implications to correct design and
>usage.
Such questions are best discussed given a specific set of
requirements for a programming task.
For example, when someone tells me to write a shape
editor where one can edit rectangles and squares, these
requirements would eventually lead to a class design,
possibly with certain subtype-relationships.
Without specific requirements, we can not derive enough
information from just the words »square« and »rectangle«
to get such a design.
== 8 of 8 ==
Date: Mon, Feb 1 2010 8:47 am
From: "Alf P. Steinbach"
* Stefan Ram:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> It has been solved by me some years ago - I don't know if
>> anyone else has published this solution, but I guess so:
>
> I have been looking around and found:
>
> http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
>
> Using the terms from this article, I can define a function:
>
> *: T -> T*
>
> that maps a type T of values to a type T* of storage cells
> for such values, and the essential assertion then becomes:
>
> * is contravariant.
>
> That is, using »<=« from this article:
>
> square <= rectangle, but
> rectangle* <= square*.
>
> So, obviously, many computer scientists are aware of
> contravariance - just some authors of web articles about
> »the square-rectangle problem« are not.
Not sure if I follow the above, it looks like obfuscation.
I discussed the ellipse/circle problem in my "pointers" tutorial, which is now
off-web. Perhaps I should put it on Google docs. Essentially, as you point out,
it is about an immutable-values-view versus a modifiable-variables view.
And yes, understanding it is essential for understanding the Liskov substitution
principle (contra-variance and co-variance), and it ties in with "const" in C++.
It also ties in with "in", "in/out" and "out" in languages that support such,
e.g. the partial support in C#. For C++ the only such support is half hidden and
very limited, namely co-variance for pointer or reference function results.
Cheers,
- Alf
==============================================================================
TOPIC: Looking for C++ IDE,...
http://groups.google.com/group/comp.lang.c++/t/e8a1db0949215858?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 4:01 am
From: John Koy
Kerem Gümrükcü wrote:
> Hi,
>
> i am looking fo a (free, non-microsoft!) C++ IDE for windows, that
> can do most of the MSVC++ stuff (resources, projects, etc.) but most
> important is the abillity to easily switch between processor targets
> for the compiler/linker e.g. it should have a 32 and 64 bit compiler
> included in the environment and 64 bit code can be compiled on
> a 32 bit system. I want to target Windows only (windows api is the
> foundation or will be), so there is no need to use a mixed environment.
The only feasible option for you is Visual Studio, no need to become a
dreamer. Besides, Windows API is C-based. It doesn't mean you cannot
develop C++ software using a C API, but it's not practical.
Actually, I doubt you want to develop with C++, it all sounds like you
really are using C.
==============================================================================
TOPIC: Safe to use substr?
http://groups.google.com/group/comp.lang.c++/t/cece8bdad80abdbe?hl=en
==============================================================================
== 1 of 2 ==
Date: Mon, Feb 1 2010 5:59 am
From: Pete Becker
LR wrote:
>
> My copy of the standard, or my most recent copy of a working draft
> explicitly initializes static const size_type npos = -1;
>
Yes, but that uses a conversion. The resulting value of npos is not -1,
but a large unsigned value.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)
== 2 of 2 ==
Date: Mon, Feb 1 2010 8:54 am
From: James Lothian
LR wrote:
> James Kanze wrote:
>> On 31 Jan, 21:19, LR <lr...@superlink.net> wrote:
>>> Immortal Nephi wrote:
>> [...]
>>> I think this will work:
>>> const std::string
>>> data = std::string("Hello ") + '\0' + std::string("World");
>> An even simpler solution might be:
>> std::string const data( "Hello \0World", 12 );
>
> I didn't think of that, but I hate to count things since I think it
> makes maintenance more difficult.
>
> LR
Presumably then you could do something like:
const char blah[] = "Hello \0World";
const std::string data(blah, sizeof(blah));
James
==============================================================================
TOPIC: ❤~❤~❤ cheap wholesale UGG shoes at www.fjrjtrade.com (paypal payment)
http://groups.google.com/group/comp.lang.c++/t/546ec6d2636da544?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 7:11 am
From: "www.fjrjtrade.com"
❤~❤~❤ cheap wholesale UGG shoes at www.fjrjtrade.com (paypal payment)
High quality discount Shoes, all on Website www.fjrjtrade.com
High quality discount UGG Shoes
http://www.fjrjtrade.com/922-UGG-Shoes.html
High quality discount UGG 30 year 5118
http://www.fjrjtrade.com/1137-UGG-30-year-5118.html
High quality discount UGG 30 year 5728
http://www.fjrjtrade.com/1138-UGG-30-year-5728.html
High quality discount UGG 5163
http://www.fjrjtrade.com/1139-UGG-5163.html
High quality discount UGG 5225
http://www.fjrjtrade.com/1140-UGG-5225.html
High quality discount UGG 5230
http://www.fjrjtrade.com/1141-UGG-5230.html
High quality discount UGG 5245
http://www.fjrjtrade.com/1142-UGG-5245.html
High quality discount UGG 5325
http://www.fjrjtrade.com/1143-UGG-5325.html
High quality discount UGG 5359
http://www.fjrjtrade.com/1144-UGG-5359.html
High quality discount UGG 5815
http://www.fjrjtrade.com/1145-UGG-5815.html
High quality discount UGG 5816
http://www.fjrjtrade.com/1146-UGG-5816.html
High quality discount UGG 5818
http://www.fjrjtrade.com/1147-UGG-5818.html
High quality discount UGG 5819
http://www.fjrjtrade.com/1148-UGG-5819.html
High quality discount UGG 5825
http://www.fjrjtrade.com/1149-UGG-5825.html
High quality discount UGG 5854
http://www.fjrjtrade.com/1150-UGG-5854.html
High quality discount Shoes, all on Website www.fjrjtrade.com
High quality discount UGG Shoes
http://www.fjrjtrade.com/922-UGG-Shoes.html
High quality discount UGG 30 year 5118
http://www.fjrjtrade.com/1137-UGG-30-year-5118.html
High quality discount UGG 30 year 5728
http://www.fjrjtrade.com/1138-UGG-30-year-5728.html
High quality discount UGG 5163
http://www.fjrjtrade.com/1139-UGG-5163.html
High quality discount UGG 5225
http://www.fjrjtrade.com/1140-UGG-5225.html
High quality discount UGG 5230
http://www.fjrjtrade.com/1141-UGG-5230.html
High quality discount UGG 5245
http://www.fjrjtrade.com/1142-UGG-5245.html
High quality discount UGG 5325
http://www.fjrjtrade.com/1143-UGG-5325.html
High quality discount UGG 5359
http://www.fjrjtrade.com/1144-UGG-5359.html
High quality discount UGG 5815
http://www.fjrjtrade.com/1145-UGG-5815.html
High quality discount UGG 5816
http://www.fjrjtrade.com/1146-UGG-5816.html
High quality discount UGG 5818
http://www.fjrjtrade.com/1147-UGG-5818.html
High quality discount UGG 5819
http://www.fjrjtrade.com/1148-UGG-5819.html
High quality discount UGG 5825
http://www.fjrjtrade.com/1149-UGG-5825.html
High quality discount UGG 5854
http://www.fjrjtrade.com/1150-UGG-5854.html
High quality discount more other shoes at WEBSITE:
http://www.fjrjtrade.com
==============================================================================
TOPIC: struct containing vector?
http://groups.google.com/group/comp.lang.c++/t/d0ba6cd9c3737991?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Feb 1 2010 8:45 am
From: cerr
Hi There,
I have a little issue going here:
I have a xml configuration file that looks kinda like this:
<PID>
<DESCRIPTION>Steveston Hwy</DESCRIPTION>
<BCAST>192.168.101.255</BCAST>
<DESTINATION>
<DESTNO>1531</DESTNO>
<DESTNO>301</DESTNO>
<DESTNO>12555</DESTNO>
</DESTINATION>
</PID>
Now there could be various <PID> tags as well as each <PID> would
likely have multiple <DESTNO> tags.
How do I store this best in my app?
I thoughtr I'd declare a struct like this:
struct structPID
{
string strBcast;
string strDescription;
vector<int> Dest;
};
and just extend the array when there's more PIDs in that file.
But when I read out the file i'm using my xml parser and i thought i'd
do something like this:
//i_PIDlist is the pointer to a variable decalred private in class
PIDClient.
bool PIDClient::readPIDConfig(string Configfile, vector<structPID>
*i_PIDlist)
{
RSXMLParser xmlPIDData(Configfile,
RSXMLParser::FILE);
if (!xmlPIDData.IsDataGood()) {
OUTPUT(std::cerr << "Document " << conf->
intersectionDataFile << " is not parsed
successfully.\n";
)
return false;
}
string strPID = xmlPIDData.GetNodeData("PID"); //PID
while (strPID.size() > 0) {
RSXMLParser xmlPID(strPID); //PID details
structPID tmpPID;
tmpPID.strBcast=xmlPID.GetNodeData("BCAST");
tmpPID.strDescription=xmlPID.GetNodeData("DESCRIPTION");
string strDest = xmlPIDData.GetNodeData("DESTINATION");
while(strDest.size() > 0) {
RSXMLParser xmlPIDDest(strDest);
xmlPIDDest.GetNodeData("DESTNO");
tmpPID.Dest->push_back();
}
i_PIDlist->push_back(tmpPID);
//delete tmpPID;
//tmpPID=NULL;
strPID = xmlPIDData.GetNext();
}
return true;
}
But there's two problems i'm seeing just right out of the bat:
If the outer while loop goes twice, how would tmpPID be re-declared?
I thought about declaring it on the heap and then calling delete in
the end of the funtion before it loops around but even then,
I would do a i_PIDlist->push_back(tmpPID) and it woudl push on a
pionter that gets ereased soon after...
Thanks for a little help and guidance here.
Ron
==============================================================================
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