Wednesday, October 29, 2008

6 new messages in 4 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* Which IDE? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/6feb0d789b8e00da?hl=en
* Non-initialized class - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/e91841714630db9c?hl=en
* priority queue question - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/0cfbab13151f495b?hl=en
* what's wrong? - 3 messages, 1 author
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/11b8342c0213e021?hl=en

==============================================================================
TOPIC: Which IDE?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/6feb0d789b8e00da?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Oct 28 2008 9:16 pm
From: DJ Dharme


On Oct 16, 4:22 pm, "doublemaster...@gmail.com"
<doublemaster...@gmail.com> wrote:
> On Oct 16, 3:42 pm, Maxim Yegorushkin <maxim.yegorush...@gmail.com>
> wrote:
>
>
>
> > On Oct 16, 9:41 am, "doublemaster...@gmail.com"
>
> > <doublemaster...@gmail.com> wrote:
> > > I am developing commandline tools for LInux.Currently i am using
> > > source insight IDE in Windows for development. Later i FTP the source
> > > to LINUX and build by make file.
>
> > > Can any one suggeest me the IDE which should get the code from VSS and
> > > transer it to LINUX (should have a menu or plugin for this) and build
> > > there
>
> > There may be no IDE for Linux which would support VSS out of the box.
>
> > You could probably access VSS from Linux using command line:http://www.kegel.com/linux/vss-howto.html. And you could probably
> > customise your Linux IDE to use your scripts for accessing a version
> > control system.
>
> > Or, better, change to a decent version control system, like
> > Subversion.
>
> > --
> > Max
>
> Actually i am working for some compny and i cant decide to change the
> VSS.
>
> But i did not give you enough information i guess.
>
> 1) I am connecting to Linux servers only on putty or some other
> terminal. It has no GUI. only command line.
>
> I have a windows system, i use source insight to view and edit the
> code [ i cant compile in windows, tool is for Linux servers]. and
> tranfer the code to Linux. then build there.
>
> [i donot have any idea why we have not been given linux system!]

There is a very good IDE called BVRDE which is written to do remote
compiling and debugging. But it supports CVS not VSS. VSS is far from
perfect, ask your colleagues to move to CVS.


==============================================================================
TOPIC: Non-initialized class
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/e91841714630db9c?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Oct 28 2008 9:53 pm
From: Michael


ejstans wrote:
> Hello,
>
> I encountered something unfamiliar to me today and I would like some
> clarifications. Unfortunately I don't have access to a standard but
> even if I did, I'm not even sure if I could understand it well enough
> to answer my question...
>
> Here's the deal: without instantiating the class, the code in question
> calls both static and non-static member functions like this:
>
> class foo {
> public:
> static void bar() { std::cout << "bar" << std::endl; }
> void bar2() { std::cout << "bar2" << std::endl; }
> };
>
> void
> func(foo* f)
> {
> f->bar();
> f->bar2();
> }
>
> int
> main()
> {
> func(NULL);
> return 0;
> }
>
> Is this allowed? And if it is, does a situation exist where it would
> be an advisable way of doing things?
In this case, you are trying to dereference a NULL pointer, which will
produce undefined behaviour.


==============================================================================
TOPIC: priority queue question
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/0cfbab13151f495b?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Oct 28 2008 10:40 pm
From: acehreli@gmail.com


On Oct 28, 12:19 pm, vaclavp...@atlas.cz wrote:

> Please write me what do you think about this :
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> // 1) first class is similar to std::priority_queue

> // common interface like std::priority_queue
> void push(const _Ty& val);
> _Ty& top();
> void pop();};

That interface allows to make those functions strongly exception-safe.

> // 2) this class has only pop and push

> void push(const _Ty& val){
> _Ty pop(){
> if( base::empty()) throw exception;
> _Ty val = base::top();
> base::pop();
> return val;
> }};

That interface cannot be made strongly exception-safe because
base::pop() changes the state of the container before the top object
is handed over to the caller.

Then, if the copy constructor of _Ty throws during 'return val;' the
top object is lost. Herb Sutter's book Exceptional C++ and many other
sources cover this. Here is one:

http://www.boost.org/community/exception_safety.html

Ali

P.S. Any name that begins with an underscore followed by a capital
letter is reserved. Ty_ would be a better name.


==============================================================================
TOPIC: what's wrong?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/11b8342c0213e021?hl=en
==============================================================================

== 1 of 3 ==
Date: Tues, Oct 28 2008 11:12 pm
From: questions


On 10月28日, 下午7时49分, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> questions wrote:
> > # include <stdio.h>
> > # include <math.h>
> > int main()
> > { long int x,y;
>
> > printf("enter an integer\n");
> > scanf("%d",&x);
>
> > y=x%pow(10,3);
> [snip]
> > The compiler tell me there is something wrong with the "pow",but I
> > don't know what's the wrong?
>
> pow() returns a floating point (in this case, I guess a double) and x is a
> long int. That is not a valid pair of operand types for the % operator.
>
> Best
>
> Kai-Uwe Bux

thanks

== 2 of 3 ==
Date: Tues, Oct 28 2008 11:13 pm
From: questions


On 10月28日, 下午7时56分, Zeppe
<ze...@remove.all.this.long.comment.yahoo.it> wrote:
> questions wrote:
> > # include <stdio.h>
> > # include <math.h>
> > int main()
> > { long int x,y;
>
> > printf("enter an integer\n");
> > scanf("%d",&x);
>
> > y=x%pow(10,3);
>
> > printf("the result is %d",y);
>
> > return 0;}
>
> > The compiler tell me there is something wrong with the "pow",but I
> > don't know what's the wrong?
>
> my compiler says:
>
> testmod.cpp:8: warning: format '%d' expects type 'int*', but argument 2
> has type 'long int*'
> testmod.cpp:10: error: invalid operands of types 'long int' and 'double'
> to binary 'operator%'
> testmod.cpp:12: warning: format '%d' expects type 'int', but argument 2
> has type 'long int'
>
> It looks pretty much clear. Listen to your compiler. It's your friend.
>
> Best wishes,
>
> Zeppe- 隐藏被引用文字 -
>
> - 显示引用的文字 -

thanks

== 3 of 3 ==
Date: Tues, Oct 28 2008 11:14 pm
From: questions


On 10月29日, 上午7时18分, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> Juha Nieminen wrote:
> > Kai-Uwe Bux wrote:
> >> Juha Nieminen wrote:
>
> >>> questions wrote:
> >>>> y=x%pow(10,3);
> >>> What's wrong with 1000?
>
> >> Nit: 1000 does not occur in the above whereas 1000.0 does occur.
>
> > But 1000 would work, whereas 1000.0 wouldn't.
>
> Ah, now I understand your point: you meant to replace pow(10,3) by 1000.
>
> Sorry for the noise.
>
> Kai-Uwe Bux

thanks

==============================================================================

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: