Tuesday, September 23, 2014

Digest for comp.lang.c++@googlegroups.com - 25 updates in 7 topics

comp.lang.c++@googlegroups.com Google Groups
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 22 04:54PM -0700

On Monday, September 22, 2014 6:23:10 PM UTC-4, Melzzzzz wrote:
> > relationship with Jesus Christ.
 
> Problem is that everything you know about Jesus Christ is through
> scriptures. And scriptures are written by such people.
 
God has never been bested. He hasn't been beaten by the enemy such
that evil, sinful men twisted His Holy word to such an extent that
we, truth-seeking people, cannot find Him.
 
He gave us those things necessary to achieve faith in this world,
and that includes scripture. And His Holy Spirit comes to live
inside of us when we are born again, and He guides us to all truth,
all righteousness, all holiness, everything that is right. It is
why His is called the "Holy" Spirit... because that's who He is.
 
http://biblehub.com/2_timothy/3-16.htm
"All scripture is given by inspiration of God, and is profitable
for doctrine, for reproof, for correction, for instruction in
righteousness:"
 
> > contrary people of the world are not a factor.
 
> There are many Christian Churches/sects and they are not even
> similar to each other.
 
A person's walk is unto the Lord alone. Those who are in pursuit of
Jesus Christ will be like Jesus Christ, and you will know each by their
fruit. If you see someone not acting like Christ, not moving in love
for others, then it is obvious and they are someone who needs to be
rebuked, prayed for, and possibly even witnessed to.
 
http://biblehub.com/john/13-34.htm
"A new commandment I give unto you, That ye love one another; as I
have loved you, that ye also love one another."
 
The spiritual galvanization between believers and non-believers will
become entrenched in these end-times. It will become exceedingly
apparent who is on which side of true faith. And many Christians
will be killed for their faith because they seek to lead people to
the One whom they are despising with everything in their life and
life's purpose.
 
Jesus is not mocked. He will repay all for everything they have
done. But He is also Love and will forgive all who come to Him.
It is sin He is putting away, and the damage done by sin through
people who voluntarily embrace sin.
 
> > from Linux Mint 14 through the current version. I was even able to
> > resize my partition each time to maintain my prior installs as well.
 
> Hm, Mint does not upgrade, how did you do that?
 
I believe Mint does upgrade. But, I have not upgraded in the traditional
sense, but rather by resizing a disk partition to about 30 GB and then
installing the next version to that partition.
 
I currently have bootup options from Linux Mint 14 through 17. :-)
 
> On Manjaro (derived from Arch Linux) all you have to do
> is `pacman -Syy && pacman -Syu` to update to current version.
> Manjaro has gui frontend(s) to package manager, too.
 
I "burn" the ISO to a USB boot disk and boot from the USB and then
do the installer. I use the same USB on my other machines and then
reformat the USB. :-)
 
Best regards,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Sep 23 10:39AM +0200

On 22/09/14 21:42, Rick C. Hodgin wrote:
> of the spirit operating within him. Very frightening.
 
> Best regards,
> Rick C. Hodgin
 
The FreeBSD logo is a picture of a cute little daemon - because in any
*nix system, there are lots of daemon processes. Many mythologies have
daemons or imps of some sort, that scuttle around in hidden places that
you don't see, either doing good or doing bad - hence the name. There
are lots of "nasty" names and terms in this business - processes often
communicate with each other by "kill", parent processes typically have
to wait for child processes to die - and if the parent dies before the
child, then the child becomes a zombie.
 
I remember in one university lecture on theoretical programming, the
professor was explaining the difference between "angelic choice" and
"daemonic choice". One student complained about the terms, saying they
were "reserved for higher things". The professor told him that if he
actually thought that, and was seriously bothered by the terms, then he
was in the wrong field of study.
 
I would say the same thing to you, Rick - you have got to get over your
petty blindness and think about what is /really/ important to you.
Otherwise you will go through life finding fault in everyone and
everything, and being unable to interact because /everyone/ has their
little faults, /every/ project is in conflict with your ideals, and
/every/ company is "evil" to some extent. The only consistent and
logical choice of lifestyle for you at the moment is a hermit living off
berries and grasshoppers - or you can wake up and realise that
dismissing a company because they have an apple in their logo, or a
programming language because they have a snake in their logo, is a sort
of childishness that most people grew out of in kindergarten.
 
 
Regarding RMS as an example, he is a complex man with very solid
opinions on several issues. Like most people, I agree with some of his
ideas (though not as radically), and disagree with others. I would not
invite him to babysit my kids, but I would happily work together on
software.
 
 
Learn to look for the good in people, and the usefulness in projects,
software, and everything else in life. Stop judging and condemning them
all by minor surface features, or assuming that you have the power to
"know the real spirit" of someone or something based on irrelevances.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 23 04:15AM -0700

On Tuesday, September 23, 2014 4:39:49 AM UTC-4, David Brown wrote:
> communicate with each other by "kill", parent processes typically have
> to wait for child processes to die - and if the parent dies before the
> child, then the child becomes a zombie.
 
http://www.visual-freepro.org/forum/viewtopic.php?f=5&t=5&p=279#p279
 
> were "reserved for higher things". The professor told him that if he
> actually thought that, and was seriously bothered by the terms, then he
> was in the wrong field of study.
 
Yes. That is a false teaching of the anti-Christ spirit. It's a
teaching which suggests that the terms we choose to use are of no
real importance and are just words, when the truth is the terms
and things we use are important.
 
We will be held accountable for every idle word. And we have the
power of life and death in our tongue. We are created by a
Loving God who is "Holy, Holy, Holy," and calls us to come out
from the world and "be ye separate." He has an eternal plan for
each of us, and that plan is wrought in His foundations of
Perfection and Holiness. The Lord's prayer asks us to pray,
"Thy will be done, on Earth as it is in Heaven."
 
Christians are referred to as Royal Priests, Ambassadors, Servants,
here in this world. We are Royal Priests of God. We are Ambassadors
of Heaven. We are Servants of the Most High, and not of the
anti-Christ spirit that is operating in this world.
 
Those who are born again will understand all of this implicitly.
It will be part of their base nature because they have been given
"spiritual eyes" to see. Those who are not born again will never
be able to understand it because it's like trying to describe
our sense of sight in terms of our other senses. You cannot explain
to a blind person who's never seen what it means to see because the
ability to see is not like hearing, tasting, touching, smelling...
But were he able to see, he would implicitly understand that aspect
of his nature. Until he is able to see it remains continuously
foreign to him, beyond his ability to understand.
 
It is the same for the people in this world. When Adam sinned
against God, he literally died spiritually that day. His spirit
nature was gone and what remained is that which we all possess
here in our natural bodies. There was real loss with Adam's sin.
The spirit died, death entered in, and we possessed a knowledge
of both good and evil.
 
The anti-Christ spirit is a spirit and he is at war with God and
uses his spiritual influence to draw us into the false things of
this world. We have death, hate, fear, division, all because of
his spiritual influence upon our blind flesh.
 
When a man comes to accept Christ and is born again, he is given
again alive spiritually, and he's been given spiritual eyes to
see, and he will look upon all things anew. His life will change
and he will not be as he was before because his spiritual eyes
give him insight, knowledge, and an understanding of things that
his carnal mind could not comprehend.
 
> dismissing a company because they have an apple in their logo, or a
> programming language because they have a snake in their logo, is a sort
> of childishness that most people grew out of in kindergarten.
 
It's not petty blindness, nor judgement, nor any of the other myriad
of things you cite. It is the differences in the spirit. And whereas
the natural man cannot comprehend the difference and will get angry
when such things are explained to them, those who are born again
implicitly know.
 
It is from within, in service to the One WE *KNOW* in our inmost man,
that we move. It is not to the outward appearance of the flesh, or
the seemingly nice sounding words which are used, which is/are completely
unrepresentative of the true state of the man. The spirit of God gives
us discernment in all things, though to varying degree by instance, and
also to varying degree by person -- the Bible refers to this as each
person being given "a measure of" discernment, along with a measure of
all of the other spiritual gifts. Just as some on this Earth are
stronger, faster, smarter, more attractive, etc., in their natural
abilities, in the spiritual component of our lives we are each also
given a measure of abilities.
 
> ideas (though not as radically), and disagree with others. I would not
> invite him to babysit my kids, but I would happily work together on
> software.
 
I agree with him on many things related to software. I have used the
GPLv3 rebranded as the PBL (Public Benefit License) for the temporary/
first license I have released by software under. I believe in the
fundamentals it employs, but I will not follow a project that is from
Richard Stallman because of the spirit which operates within him, and
makes him move the way he does (even unbeknownst to him, for he will
think he is being just as he is when in fact he is being influenced
spiritually to be the way he is, and were he free from that spirit he
would be different in a great many ways -- as would all people).
 
It's why so many marriages end in divorce. People are isolated
individuals until they are married. When they marry God joins them
and they become one flesh. When that happens the spirits living
inside of one of them are able to then go to the other one under a
type of "legal license" which causes the other person to immediateley
change. Each spirit interacts with each person in varying ways, and
the spirits the wife had left in, and the spirits the husband had let
in to their own lives prior to getting married, are now communal
between the two. This causes people to "change overnight" and behave
in new ways, having new feelings, new anger, new drives, new desires.
Things they never would've considered to be part of their lives
before are now part of their lives, and they themselves don't under-
stand why that is, but they also can't deny the fact that it's true.
 
The nature God describes to us in scripture is our true nature. We
are flesh-based people under the dominion of this enemy until we are
willing to seek the Truth, and such comes from an inward change that
is not of us, but is a supernatural calling by God Himself, and is of
a similar kind to our original birth -- something we personally had
no part in (except being along for the ride).
 
When God changes a person they are forever changed. The old has
passed, the new has come.
 
I testify that this is true, and that God's guidance for us through
scripture, through His Holy Spirit, that all of it is entirely and
completely true. And before it happened to me I would've argued
with anyone who would suggest such a thing were possible that such
a thing was, in fact, not possible, and that they were totally and
completely crazy to even believe such a notion. But since it has
happened to me ... I am floored by it. It is real and it is available
to anyone who will hear the truth. All they have to do is be willing
to put aside personal notions about what they believe and pursue the
truth, no matter if it takes them left, right, forward, backward, or
off in some unexpected direction.
 
> software, and everything else in life. Stop judging and condemning them
> all by minor surface features, or assuming that you have the power to
> "know the real spirit" of someone or something based on irrelevances.
 
The Bible teaches us to be discerners of all things, and to cling to what
is good, but to abhor what is evil.
 
I do this to the best of my ability. But my call in this world is also
to be salt and light. I explain the things of God unto others. I teach
so that they too might hear, come out, and be saved as I was.
 
There are two aspects of our nature. One is the natural, which is our
flesh, our lives here in this world. We can touch a tree, pet a dog,
feel, taste, touch, and do, etc. The other is the spiritual. Until a
person is born again they cannot know any aspect of that spiritual
world, but the spiritual world is the more important of the two. It
is eternal and it is that part of us which really matters, for
everything here will pass away. Everything here will be consumed
in fervent heat. Everything a man does for the flesh, in service to
this world, will be lost. But everything a man does in service to
the Lord, in service to His Kingdom, being built upon Him, will
continue on beyond this world, for it is of the spirit, and he is
building something which is eternal.
 
It's why Visual FreePro has received no helpers to date, because the
anti-Christ spirit operating inside of them (resident demons, or some
external influence at the "significant points" of a person's life in
terms of choices, forks in the road, where these powerful plotting
demons show up to influence a person to make the wrong choices, which
are those choices against the way God's Holy Spirit would have them
go), know that there is real gain in a project like this, founded upon
the Savior of all mankind, the King of the Universe, that works being
given over to Him in this world are a right course, and that by giving
the product away for free the people receive directly from the Lord
Himself, rather than from me personally.
 
The spirit that a person operates under in this world is exceedingly
important. It is why the Christian will discern all things and then
move accordingly.
 
I pray you come to know this, David, and make it your own. Only
when you are willing to embrace truth, to receive Jesus Christ into
your heart, will this happen. It is the same for all people. Until
that time, it will forever remain utter and total foolish nonsense.
 
The foundation upon which we build our lives is important. As for
me and my house, we strive with great effort and passion to serve
the Lord, citing explicitly Jesus Christ as to why we have any hope,
why we have any ability, why we have any opportunity, why we have
any thing that we possess, that these are all gifts from Him, and
they are to be received in a like manner, to then be given back to
Him as He intended them to be used.
 
I have the attributes I do ... and they are to be used for Godly
purposes, with a foundation built atop God. They are not to be
used for personal purposes, or a foundation built atop something
other than God. And each born again Christian's life will be one
of service to God, service to their fellow man, to be salt and
light, to teach those in this world the things that they do not
know because the anti-Christ spirit does not teach them these
things, and goes to great lengths to prevent them from being taught.
 
Jesus is alive. He is seated at the right-hand of God waiting for
the day the Father tells Him it's time to return. Until He returns,
our service is unto His Kingdom -- a Kingdom of Power, of Spirit, of
Light, and of eternity.
 
It is for Jesus the born again Christian moves. It is not to serve
man as per man's needs, but rather to serve man as per God's needs,
in that we hold everything we do up before Him in our walk. We
continually listen to God who guides us spiritually to make our
choices. And just as children grow up learning how to operate in
this world, the born again Christian grows up learning how to operate
in the spiritual world. They make mistakes, are corrected by their
Father in Heaven, and they continue on. At some point they mature
and are operating as proper Servants here in this world. And just
as with natural attributes, purpose and discipline to the Most Hight
will hone the spiritual nature and attirbutes, just as purpose and
discipline on natural things in this world (study, learning a
profession, working out) will hone our natural things.
 
We have a purpose in this world ... and it is to serve God. The things
that we expose ourselves to, the things we are a part of, these matter.
We are called to serve God in all we do, and if we proceed from some
other foundation than Jesus Christ, it will be to our loss compared
with the effort which begins with a solid foundation upon Jesus Christ.
 
To put simply: We were bought with a price at the cross by the shed
blood of Jesus Christ. Our lives are not our own. We are Servants
in this world. But the servant nature of our term of Service unto
the Lord is not the same as a Servant nature here in this world, in
that as we are Servants of Him and His Holy eternal Kingdom, it is
in our gain, and not our debt, that we operate in this way, for His
ways are not like the world's ways. And His economy is not like
the world's economy. He has fire that burns without consuming the
fuel. Fishes and loaves that are able to feed without depleting.
Supernatural abilities and miracles are His domain and dominion,
something that we've all heard of but don't have a true knowledge of
until we are born again and come into the inherent spiritual
understandings given us by God.
 
It is why every knee shall bow, an every tongue confess, that Jesus
Christ is Lord, to the glory of God the Father ... because HE IS.
It is glorious beyond measure.
 
Best regards,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Sep 23 02:48PM +0200

On 23/09/14 13:15, Rick C. Hodgin wrote:
<snip>
 
And you wonder why no one joins your projects - except perhaps some who
will put up with /anything/ as long as they get paid?
 
I have met, talked to, studied with, and worked with many Christians
over the years - ranging from "Sunday Christians" to dedicated "Jesus is
everything to me" born-again Christians, and I had an old relative who
was a Catholic monk. But I am not sure I have met anyone so totally
disconnected from reality as you show yourself. I certainly have never
met anyone who claimed to be a Christian, yet worked so hard to drive
any doubters or curious people away from Christianity. You paint such a
dismal, inhumane, lonely, frustrated and - quite frankly - insane
picture of Christianity that you will alienate anyone involved with you.
 
I am not telling you this because I want another thousand words about
how the world is guided by evil spirits, or how wonderful you claim God
is (despite how miserable you are). I am telling you this in the vague
hope that you might think about how you appear from the outside, and how
people view your outpourings (those people that read them rather than
just ignoring them entirely). I am trying to be a mirror here, because
you obviously have never thought about these things - otherwise you
would have changed your methods.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 23 05:59AM -0700

On Tuesday, September 23, 2014 8:49:16 AM UTC-4, David Brown wrote:
> I am not telling you this because I want another thousand words about
> how the world is guided by evil spirits, or how wonderful you claim God
> is (despite how miserable you are).
 
I am not miserable. I am filled with inner peace and joy, and this
persists continually no matter what outward facing thing I encounter.
That inner peace and joy does not change the difficulties I face in
those outward facing things I encounter.
 
> I am trying to be a mirror here, because
> you obviously have never thought about these things - otherwise you
> would have changed your methods.
 
The pure gospel message is offensive to our flesh, to those who are
perishing. To those who are saved, it is our Living Hope in Him.
 
The world really is black and white. People when they die are going
to enter into an eternity with God having been forgiven for their
sins because they received the Truth while here upon this Earth. Or
they will enter into a fiery Hell forever because they would not let
go of sin.
 
It is because I care about people too much to send them off unaware
that I teach others. Some will hear, repent, come out, and be saved.
Others will never hear no matter how properly, softly, with love
throughout, the message is conveyed. Sin is the enemy. Total and
complete enemy. All it does is destroy unto Death. It's why Jesus'
sacrifice on the cross is SO ESSENTIAL and SO AMAZING. He takes
our sin away. He takes our Death away. He SAVES us literally.
 
I pray you come to understand this, David. I love you, but God
loves you more. Seek Him.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 05:33PM +0100

On 23/09/2014 13:59, Rick C. Hodgin wrote:
> I pray you come to understand this, David. I love you, but God
> loves you more. Seek Him.
 
Evolution is proof that your god doesn't exist mate; one cannot seek
what does not exist.
 
/Flibble
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Sep 23 10:00AM -0700

On Tuesday, September 23, 2014 12:33:02 PM UTC-4, Mr Flibble wrote:
> > loves you more. Seek Him.
 
> Evolution is proof that your god doesn't exist mate; one cannot seek
> what does not exist.
 
A deceived person cannot see the Creator and His creation because it
is the truth, and the anti-Christ spirit is that which drives the
deceived person from within. People are either the children of God,
or they are children of the devil. Those who are children of the
devil will go their grave deceived, believing the lie of the enemy,
which covers the entirety of their existence by their own desire to
embrace sin and everything false. It will be their own embracing
of that falseness, and their outright refusal to believe the Truth,
which will lead them to their eternal Grave.
 
I pray you come out of this delusion. The enemy is leading the whole
Earth astray. The entire world. All people who are not actively
seeking after the Truth, after Jesus Christ and His Holy Spirit
directly, Flibble, will perish.
 
If you come out and receive Him, you'll be eternally grateful. And
weap your eyes out in repentance over your sin, as all who come to
believe in Him have done, including me.
 
http://biblehub.com/john/8-42.htm
http://biblehub.com/john/8-43.htm
http://biblehub.com/john/8-44.htm
http://biblehub.com/john/8-45.htm
http://biblehub.com/john/8-46.htm
http://biblehub.com/john/8-47.htm
 
Read this carefully. It has the power to lead you to salvation, to
the One who saves.
 
"42 Jesus said unto them, If God were your Father, ye would love me:
for I proceeded forth and came from God; neither came I of myself,
but he sent me.
"43 Why do ye not understand my speech? even because ye cannot hear
my word.
"44 Ye are of your father the devil, and the lusts of your father ye
will do. He was a murderer from the beginning, and abode not in the
truth, because there is no truth in him. When he speaketh a lie, he
speaketh of his own: for he is a liar, and the father of it.
"45 And because I tell you the truth, ye believe me not.
"46 Which of you convinceth me of sin? And if I say the truth, why
do ye not believe me?
"47 He that is of God heareth God's words: ye therefore hear them
not, because ye are not of God."
 
A fearful place to be, Flibble. Seek deeply the Truth. If you do,
you WILL find it. It is not hidden, except to those who will not see.
 
Best regards,
Rick C. Hodgin
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 06:08PM +0100

On 23/09/2014 18:00, Rick C. Hodgin wrote:
>> what does not exist.
 
> A deceived person cannot see the Creator and His creation because it
> is the truth, and the anti-Christ spirit is that which drives the
 
[snip]
 
The truth is that evolution is a fact mate; this fact is proof that your
god doesn't exist.
 
/Flibble
woodbrian77@gmail.com: Sep 22 07:14PM -0700

On Monday, September 22, 2014 2:53:06 PM UTC-5, Mr Flibble wrote:
> This newsgroup is very poor; it has no sausages at all!
 
Leigh, how about fixing these warnings from your
segmented_array code? I grabbed a copy of your code
a few weeks ago.
 
clang++ -std=c++11 -O2 -W -Wall -I. -I /usr/local/include -I/usr/local/include/boost-1_56_0_b1/boost -I /home/brian/src/segmented_array -c zz.bigtest.cc
In file included from zz.bigtest.cc:1:
In file included from ./zz.bigtest.hh:11:
In file included from /home/brian/src/segmented_array/segmented_array.hpp:42:
/home/brian/src/segmented_array/vecarray.hpp:55:15: warning:
'neolib::vecarray_overflow::what' hides overloaded virtual function
[-Woverloaded-virtual]
const char* what() { return "vecarray overflow"; }
^
/usr/include/c++/v1/exception:95:25: note: hidden overloaded virtual function
'std::exception::what' declared here: different qualifiers (const vs none)
virtual const char* what() const _NOEXCEPT;
^
In file included from zz.bigtest.cc:1:
In file included from ./zz.bigtest.hh:11:
In file included from /home/brian/src/segmented_array/segmented_array.hpp:42:
/home/brian/src/segmented_array/vecarray.hpp:62:4: warning: expression result unused
[-Wunused-value]
aValid;
^~~~~~
2 warnings generated.
 
 
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 23 06:06PM +0100


> Brian
> Ebenezer Enterprises - In G-d we trust.
> http://webEbenezer.net
 
Fixed. v3.0.1.
 
/Flibble
MikeCopeland <mrc2323@cox.net>: Sep 22 08:18PM -0700

I'm having difficulty deleting items from a vector, and I suspect
it's a problem with how I'm using my iterator.
I my vector populated, and after some logic I wish to scan the vector
and erase certain items as I go. Below is the actual code I use, and
the program aborts when I execute the first "erase" call. In my
application, I can't do the delete "outside" of the loop.
Given the code below, is there a way to delete object from a vector
in this manner...or how might I do it? Please advise. TIA
 
for(vIter = defVect.begin(), iii = 0; vIter != defVect.end(); vIter++,
iii++)
{
defWork = *vIter;
if(defWork.recVal >= uuu)
defVect.erase(vIter+iii);
}
 
 
 
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Ian Collins <ian-news@hotmail.com>: Sep 23 03:31PM +1200

MikeCopeland wrote:
> if(defWork.recVal >= uuu)
> defVect.erase(vIter+iii);
> }
 
A (simplified) alternative is:
 
for( vIter = defVect.begin(); vIter != defVect.end(); )
{
if( condition_to_erase )
{
vIter = defVect.erase( vIter );
}
else
{
++vIter;
}
}
 
--
Ian Collins
Barry Schwarz <schwarzb@dqel.com>: Sep 22 09:44PM -0700

On Mon, 22 Sep 2014 20:18:32 -0700, MikeCopeland <mrc2323@cox.net>
wrote:
 
> if(defWork.recVal >= uuu)
> defVect.erase(vIter+iii);
> }
 
Since you increment vIter even when you do an erase, you will skip
over the next element after each erase. Consider the case where your
vector contains 0,1,2,3,4. If you delete the element when the
iterator points to 2, the vector becomes 0,1,3,4 and your iterator
points to 3. You then increment the iterator for the next iteration
and it points to 4. You never process the element containing 3.
 
As soon as vIter points past the halfway point of the vector elements,
vIter+iii will point beyond the end of the vector. In the above
example, if 3 is the first element you choose to delete, vIter+iii is
an invalid iterator value (well beyond the end of the vector).
 
Ian's post shows you how to solve the first problem. Since we don't
know what vIter+iii is supposed to be, it's a little harder to suggest
a solution for the second.
 
--
Remove del for email
MikeCopeland <mrc2323@cox.net>: Sep 22 10:24PM -0700

In article <43u12a93nfdqub26rtefu1p6mau0kkai3t@4ax.com>,
schwarzb@dqel.com says...
 
> > I my vector populated, and after some logic I wish to scan the
vector
 
> Ian's post shows you how to solve the first problem. Since we don't
> know what vIter+iii is supposed to be, it's a little harder to suggest
> a solution for the second.
 
"iii" is used within the for loop to point to the offset of the item
to be deleted. However, I see the error in my code here: it should have
been "vIter.begin()+iii". My bad... 8<{{
Your post helped me see that. <sigh>
 
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Ian Collins <ian-news@hotmail.com>: Sep 23 05:37PM +1200

MikeCopeland wrote:
> to be deleted. However, I see the error in my code here: it should have
> been "vIter.begin()+iii". My bad... 8<{{
> Your post helped me see that. <sigh>
 
Why do you need an offset when you have an iterator?
 
--
Ian Collins
MikeCopeland <mrc2323@cox.net>: Sep 23 07:25AM -0700

In article <c8cf8oFr2t7U2@mid.individual.net>, ian-news@hotmail.com
says...
> >> Ian's post shows you how to solve the first problem. Since we
don't
> > been "defVect.begin()+iii". My bad... 8<{{
> > Your post helped me see that. <sigh>
 
> Why do you need an offset when you have an iterator?
 
I had played with this problem and tried to make it work, I guessed
that the way I was using the iterator probably wasn't right. I looked
at Google and found examples which used "iterator.begin()+offset" to
erase and thought it would work. My post of last night (which I've
corrected here) was all wrong, so I've misled you there. My apologies.
Note to self: don't post late at night when the old brain is barely
functioning. 8<}}
 
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Barry Schwarz <schwarzb@dqel.com>: Sep 23 08:49AM -0700

On Mon, 22 Sep 2014 22:24:17 -0700, MikeCopeland <mrc2323@cox.net>
wrote:
 
>to be deleted. However, I see the error in my code here: it should have
>been "vIter.begin()+iii". My bad... 8<{{
> Your post helped me see that. <sigh>
 
I assume you meant defVect.begin()+iii.
 
If that is what you want to do, then Ian's post shows you how without
bothering with the offset. Note that defVect.begin()+iii and vIter
both point to the same element.
 
--
Remove del for email
Hongliang Wang <loudking@gmail.com>: Sep 23 06:59AM -0700

Hello all, I used to be a C programmer and my way to print error messages is following:
 
1. Store all messages in a header file:
 
/* error.h */
#define ERROR_01 "Unable to open file: '%s'"
 
2. Include that header file in source file and use printf to print error messages.
 
/* source.c */
if (error) {
printf(ERROR_01, file_name);
exit(1);
}
 
Now I move to C++ but it seems that cout does not support %s thing.
 
So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
Thanks in advance.
Victor Bazarov <v.bazarov@comcast.invalid>: Sep 23 10:50AM -0400

On 9/23/2014 9:59 AM, Hongliang Wang wrote:
> }
 
> Now I move to C++ but it seems that cout does not support %s thing.
 
> So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
There is no need for you to change anything. The C++ Standard library
includes the C Standard library, and 'printf' is still there. Only
switch to new C++ mechanisms when you find that old C ones don't work
anymore for you.
 
In a real-world application error messages are output to a special
window (if it's a GUI application) or to the console (like you have
there), and often also to a log (however that might be implemented).
The latter mechanism is frequently brought in from a 3rd party library.
 
V
--
I do not respond to top-posted replies, please don't ask
Wouter van Ooijen <wouter@voti.nl>: Sep 23 04:55PM +0200

Hongliang Wang schreef op 23-Sep-14 3:59 PM:
> }
 
> Now I move to C++ but it seems that cout does not support %s thing.
 
> So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
C++ is a more-or-less superset of C, so you could simply do as you
always did.
 
A more C++-ish way would be to use exceptions:
 
// in the header file
class unable_to_open_file : public std::exception {
public:
unable_to_open_file( const std::string & name ):
s{ std::string{ "unable_to_poen_file [" } + name + "]" }
{}
const char * what() const override {
return s.c_str();
}
private:
std::string s;
};
 
// in the code
if (error) {
throw unable_to_open_file{ file_name };
}
 
Wouter van Ooijen
drew@furrfu.invalid (Drew Lawson): Sep 23 02:57PM

In article <25e3b7c7-3ecd-4460-97c6-c018230f8fec@googlegroups.com>
 
>So may I ask what is your way to print error messages?
 
I use syslog(). Unfortunately for this discusson, that is not a
standard C++ component.
 
>Is it still possible to put all error messages in a header file?
 
You can put whatever you want in a header file.
 
--
Drew Lawson | "But the senator, while insisting he was not
| intoxicated, could not explain his nudity."
Christopher Pisz <nospam@notanaddress.com>: Sep 23 09:58AM -0500

On 9/23/2014 8:59 AM, Hongliang Wang wrote:
 
> Now I move to C++ but it seems that cout does not support %s thing.
 
> So may I ask what is your way to print error messages? Is it still possible to put all error messages in a header file?
 
> Thanks in advance.
 
You don't need %s, because std::cout is a stream and the stream already
knows how to format a string. It also knows how to format other
primitive types. If you need it to format a custom class, you can supply
a function for that with your class. See the faq at
http://www.parashift.com/c++-faq/output-operator.html
 
Your code would be
 
/* error.h */ // You probably want a safer name here
#define ERROR_01 "Unable to open file"
 
/* source.c */
#include <iostream>
 
if (error)
{
// You could also use std::cerr instead of std::cout
std::cout << ERROR_01 << ": " << file_name;
exit(1); // Maybe throw or return error code here instead
}
ram@zedat.fu-berlin.de (Stefan Ram): Sep 23 02:31PM

>%s thing
 
It's a format specifier.
markus <markus@addr.is.invalid>: Sep 23 09:22AM +0200

On Windows wchar_t, char16_t and unsigned short/uint16_t all use the
same underlying type uint16_t. According the C++11 standard they are all
distinct types.
 
Looking at the Firefox source, they are (reinterpret)casting between
char/char16_t/wchar_t.
 
Looking at the Qt source, depending on the platform they are happily
casting between uint16_t/wchar_t or uint32_t/wchar_t.
 
From what I can tell, this does violate the aliasing rules. Am I
missing something? Do GCC/Visual C++ make some special guarantees that
this will work?
MikeCopeland <mrc2323@cox.net>: Sep 22 08:12PM -0700


> > C++14 is already out. Which vendors do not support it?
 
> You can guess three times ;-) And yes, that's the one what OP is using
> (although I hope he has moved forward from MSVC6 by now).
 
Ahhh, you've been keeping track...that's scary... 8<}}
Yes, after much prompting (pressure) from this group, I have in fact upgraded my compiler...TWICE! I converted to MSVS10, and recently have been using MSVS13.
(I trust that's a bit more "with it", and I hope my problems are more realistic...)
 
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: