Wednesday, April 29, 2009

comp.lang.c++ - 25 new messages in 12 topics - digest

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

comp.lang.c++@googlegroups.com

Today's topics:

* 64 bit C++ and OS defined types - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/88f3870fe9a84e70?hl=en
* Is this String class properly implemented? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/6d95b63c2d32064a?hl=en
* Ascii Characters - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b426276abbbce135?hl=en
* We are a team who will provide you students with any of your Pearson
published books resources - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/537a22e8a6d01887?hl=en
* open Souce project in C/C++/Java to convert html, doc, pdf to BMP - 1
messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/f238b5078d593099?hl=en
* Window C++ Compiler - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/c70a2463dd900f3e?hl=en
* Array - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/b1092101f739d07a?hl=en
* Implicit conversion and method call - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/1af613b157b9cd86?hl=en
* Polymorphism at run-time - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/afb5fdfa6ae286c5?hl=en
* ===Welcome to comp.lang.c++! Read this first. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/ae9cc4cc92a3c722?hl=en
* Delegates ,smart pointers and GUI - 7 messages, 3 authors
http://groups.google.com/group/comp.lang.c++/t/f5ef7b3e0a822708?hl=en
* Can't pinpoint linker error - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/ee34b2c94d37308d?hl=en

==============================================================================
TOPIC: 64 bit C++ and OS defined types
http://groups.google.com/group/comp.lang.c++/t/88f3870fe9a84e70?hl=en
==============================================================================

== 1 of 3 ==
Date: Wed, Apr 29 2009 12:04 am
From: "Tony"


Alf P. Steinbach wrote:

> Hm, EC++ is AFAIK dead,

Or sleeping.


== 2 of 3 ==
Date: Wed, Apr 29 2009 12:24 am
From: "Tony"


SaticCaster wrote:

> The code analyzer Viva64 will simplify migration process!
> http://www.viva64.com/viva64-tool/

Expensive.


== 3 of 3 ==
Date: Wed, Apr 29 2009 10:14 am
From: "Bo Persson"


Tony wrote:
> Alf P. Steinbach wrote:
>
>>> Why do you want a signed type to indicate a quantity, which can't
>>> be negative? Aren't you wasting half its potential values?
>>
>> No, there's no waste except for the case of a single byte array
>> that's more than half the size of addressable memory, which on a
>> modern system you simply will not ever have. There's no waste
>> because that extra range isn't used, and cannot be used (except
>> for the single now purely hypothetical case mentioned).
>
> Would you ever use a signed integer to represent a memory address?

No, but perhaps a pointer. :-)


Bo Persson

==============================================================================
TOPIC: Is this String class properly implemented?
http://groups.google.com/group/comp.lang.c++/t/6d95b63c2d32064a?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 12:18 am
From: "Tony"


James Kanze wrote:
> On Apr 19, 4:37 am, kevintse.on...@gmail.com wrote:
>> On Apr 18, 7:52 pm, Obnoxious User <O...@127.0.0.1> wrote:
>>> is completely useless from my perspective. How about yours?
>
>>> String(L"åäö").toUpperCase(); // <-!?
>
>> But this is convenient when you need to do case conversions of
>> English words.
>
> No. About the only use it could have is as an example of how
> not to do the job. It fails on implementations not using ASCII,
> for example, and it fails for English words like "naïve".

7-bit ASCII is your friend. OK, not *your* friend maybe, but mine for sure!

==============================================================================
TOPIC: Ascii Characters
http://groups.google.com/group/comp.lang.c++/t/b426276abbbce135?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 1:28 am
From: pjb@informatimago.com (Pascal J. Bourguignon)


Jack Klein <jackklein@spamcop.net> writes:

>> typedef int ASCII_Code;
>
> Why not always define it as an int?

Because ASCII codes have only 7 bits. If you can store these 7 bits
in a unsigned char then vectors of ASCII codes will take less memory
space.

--
__Pascal Bourguignon__

==============================================================================
TOPIC: We are a team who will provide you students with any of your Pearson
published books resources
http://groups.google.com/group/comp.lang.c++/t/537a22e8a6d01887?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 5:52 am
From: Victor Bazarov


instructors.team@gmail.com wrote:
> [..] We are a team [..]

No, you're not.

==============================================================================
TOPIC: open Souce project in C/C++/Java to convert html, doc, pdf to BMP
http://groups.google.com/group/comp.lang.c++/t/f238b5078d593099?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 6:32 am
From: red floyd


prashanthegde81@gmail.com wrote:
> Hi All
>
> Is there any open Souce project in C/C++/Java to convert html, doc,
> pdf to BMP?
>
> I would like to get the Bitmap image of contents rendered in the Web
> Browser ActiveX control. I want to get the good quality image so I
> don't want to use images from the view (rendered content).
>
> Is there any alternate method?
>
>

I just checked my copy of the Standard, and it doesn't mention Bitmaps,
Web Browser, or ActiveX.

May I suggest posting in a newsgroup with Windows or Visual Studio in
its name?

See FAQ 5.9

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

==============================================================================
TOPIC: Window C++ Compiler
http://groups.google.com/group/comp.lang.c++/t/c70a2463dd900f3e?hl=en
==============================================================================

== 1 of 3 ==
Date: Wed, Apr 29 2009 6:33 am
From: red floyd


cplusplusquestion@gmail.com wrote:
> I'm using Linux C++ compiler. Is there anyone recommend me which free
> Window C++ compiler is good? Thanks!

G++ has a Windows port as well. Google for MinGW. If you'd prefer a
full Linux style environment, google for Cygwin.


== 2 of 3 ==
Date: Wed, Apr 29 2009 8:43 am
From: Noah Roberts


red floyd wrote:
> cplusplusquestion@gmail.com wrote:
>> I'm using Linux C++ compiler. Is there anyone recommend me which free
>> Window C++ compiler is good? Thanks!
>
> G++ has a Windows port as well. Google for MinGW. If you'd prefer a
> full Linux style environment, google for Cygwin.

You don't need Cygwin to get the Linux unix shell and tools. The people
who make MinGW also make Msys. You only need Cygwin if you need unix
compatibility.

The g++ for MinGW is a touch dated.

Quite frankly, and quite unfortunately in my opinion, the best compiler
for windows is the one made by microshaft. Get the Express edition of
VS and download the win32 components if you want to do GUI programming.


== 3 of 3 ==
Date: Wed, Apr 29 2009 10:08 am
From: "Bo Persson"


Noah Roberts wrote:
> red floyd wrote:
>> cplusplusquestion@gmail.com wrote:
>>> I'm using Linux C++ compiler. Is there anyone recommend me which
>>> free Window C++ compiler is good? Thanks!
>>
>> G++ has a Windows port as well. Google for MinGW. If you'd
>> prefer a full Linux style environment, google for Cygwin.
>
> You don't need Cygwin to get the Linux unix shell and tools. The
> people who make MinGW also make Msys. You only need Cygwin if you
> need unix compatibility.
>
> The g++ for MinGW is a touch dated.
>
> Quite frankly, and quite unfortunately in my opinion, the best
> compiler for windows is the one made by microshaft. Get the
> Express edition of VS and download the win32 components if you want
> to do GUI programming.

Yes, the question is if you want to do *nix programming on Windows, or
if you really want to so some Windows programming?


Bo Persson

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

== 1 of 1 ==
Date: Wed, Apr 29 2009 6:34 am
From: red floyd


hasib wrote:
> I am Mohammed. I am reading in Islamic University of Technology( IUT).
> What is the main pupose of the 'ARRAY' and when it is used? Any answer
> is appreciable. Thank you from Mohammed. Good bye.

Your answer may be found here:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2

==============================================================================
TOPIC: Implicit conversion and method call
http://groups.google.com/group/comp.lang.c++/t/1af613b157b9cd86?hl=en
==============================================================================

== 1 of 3 ==
Date: Wed, Apr 29 2009 6:59 am
From: GeeRay


Hi all,
how can I create a template class to decorate a type and use it as the
type itself?

For example:

I want to do this:

#include <iostream>
class A
{
public:
A(){};
virtual ~A(){};
void foo(){ std::cout << "foo" << std::endl;};
};


template<class T>
class B
{
public:
B(){};
virtual ~B(){};

operator T(){return instance;};
private:
T instance;
};

int main(int argn, char* argv[])
{
B<A> b();
b.foo();
}


Is it possible?

Thanks in advance.


== 2 of 3 ==
Date: Wed, Apr 29 2009 7:43 am
From: Victor Bazarov


GeeRay wrote:
> Hi all,
> how can I create a template class to decorate a type and use it as the
> type itself?
>
> For example:
>
> I want to do this:
>
> #include <iostream>
> class A
> {
> public:
> A(){};
> virtual ~A(){};
> void foo(){ std::cout << "foo" << std::endl;};
> };
>
>
> template<class T>
> class B
> {
> public:
> B(){};
> virtual ~B(){};
>
> operator T(){return instance;};
> private:
> T instance;
> };
>
>
>
> int main(int argn, char* argv[])
> {
> B<A> b();

Drop the parentheses, otherwise you're declaring a function. My answer
assumes that the definition of 'b' is like this:

B<A> b;

> b.foo();
> }
>
>
> Is it possible?

No. For the member function calls (like the . you use to access the
'foo' member) the conversions are not considered. You can overload the
member access operator for pointers (pretending that your 'B' class is a
pointer), like so:

template<class T> class B { ...

T* operator->() { return &instance; }
};

, then you could write something like

B<A> b;
b->foo();

which is not necessarily the best syntax, of course...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


== 3 of 3 ==
Date: Wed, Apr 29 2009 9:35 am
From: Vladimir Jovic


Victor Bazarov wrote:
> GeeRay wrote:
>> Hi all,
>> how can I create a template class to decorate a type and use it as
>> the type itself?
>>
>> For example:
>>
>> I want to do this:
>>
>> #include <iostream>
>> class A
>> {
>> public:
>> A(){};
>> virtual ~A(){};
>> void foo(){ std::cout << "foo" << std::endl;};
>> };
>>
>>
>> template<class T>
>> class B
>> {
>> public:
>> B(){};
>> virtual ~B(){};
>> operator T(){return instance;};
>> private:
>> T instance;
>> };
>>
>>
>>
>> int main(int argn, char* argv[])
>> {
>> B<A> b();
>
> Drop the parentheses, otherwise you're declaring a function. My answer
> assumes that the definition of 'b' is like this:
>
> B<A> b;
>
>> b.foo();
>> }
>>
>>
>> Is it possible?
>
> No. For the member function calls (like the . you use to access the
> 'foo' member) the conversions are not considered. You can overload the
> member access operator for pointers (pretending that your 'B' class is a
> pointer), like so:
>
> template<class T> class B { ...
>
> T* operator->() { return &instance; }
> };
>
> , then you could write something like
>
> B<A> b;
> b->foo();
>
> which is not necessarily the best syntax, of course...

Another happy solution:
static_cast< A >(b).foo();

or something little better:

#include <iostream>
class A
{
public:
A(){}
virtual ~A(){}
void foo(){ std::cout << "foo" << std::endl;}
};
template<class T>
class B
{
public:
B(){}
~B(){}

T& operator()(){ return instance; }
private:
T instance;
};
int main(int argn, char* argv[])
{
B<A> b;
b().foo();
}

==============================================================================
TOPIC: Polymorphism at run-time
http://groups.google.com/group/comp.lang.c++/t/afb5fdfa6ae286c5?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 8:17 am
From: Jeff Schwab


Steven G. Johnson wrote:
> On Apr 28, 2:10 pm, Jeff Schwab <j...@schwabcenter.com> wrote:
>> Well, far be it for me to argue with the you on this topic, but what
>> genfft does, IIUC, is effectively run-time code generation of the sort
>> usually restricted to interpreted languages. If you call the compiler
>> on the client machine, you're defying the traditional compile-then-run
>> ordering. It's a nice technique, and I'd like to see it used more
>
> Except that it doesn't call the code generator on the client machine.
> FFTW doesn't call the code generator at all at runtime for the client
> who is computing FFTs. That is the misunderstanding I was pointing
> out.
>
> genfft is essentially a special-purpose compiler for a domain-specific
> language. But like an ordinary compiler, it is run at build time, or
> even before (most users never run genfft at all, and rely on the
> generated C code that we ship with FFTW). FFTW indeed has the
> "traditional compile-then-run ordering."
>
> (In fact, it's not even possible for FFTW to call the code generator
> at runtime, since the code generator is written in OCaml, and FFTW
> does not require an OCaml system in order to be compiled or run by end
> users.)

Well, thanks for setting me straight. I was under the impression that
FFTW required the presence of a C compiler at run-time; was I mistaken?

==============================================================================
TOPIC: ===Welcome to comp.lang.c++! Read this first.
http://groups.google.com/group/comp.lang.c++/t/ae9cc4cc92a3c722?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Apr 29 2009 9:30 am
From: Shiva


Welcome to comp.lang.c++! Read this first.

This post is intended to give the new reader an introduction to reading
and posting in this newsgroup. We respectfully request that you read
all the way through this post, as it helps make for a more pleasant
and useful group for everyone.

First of all, please keep in mind that comp.lang.c++ is a group for discussion
of general issues of the C++ programming language, as defined by the ANSI/ISO
language standard. If you have a problem that is specific to a particular system
or compiler, you are much more likely to get complete and accurate answers in a
group that specializes in your platform. A listing of some newsgroups is given
at the end of this post.

The FAQ (Frequently Asked Question) list has a wealth of information for
both the new and veteran C++ programmer. No matter what your experience
level, you are encouraged to read the entire list, if only to familiarize
yourself with what answers are available to minimize redundant replies.
The comp.lang.c++ FAQ is available at http://www.parashift.com/c++-faq-lite/

If the FAQ list does not help, then many regular readers of this group
are happy to assist with problems of standard C++. We have only a few
requests that we ask be adhered to, for the benefit of all:

* Please put a short summary in the subject line. Descriptions such as
"HELP!!!!!!" are not helpful, and many regular posters ignore such
requests. A good example is, "Problem with Virtual Functions."

* State the question or the problem clearly and concisely. Describe what
you are trying to do, and the problem you are running into. Include all
relevant error messages.

* Include the smallest, complete and compilable program that exhibits your
problem. As a rule, posters in comp.lang.c++ will not do homework, but will
give helpful hints if you have shown some willingness to try a solution.

* comp.lang.c++ is forum for discussion, and as such some regular posters do
not give E-mail replies. Very often follow-ups to postings have corrections,
so plan on taking part in the discussion if you post a question. If you
do receive e-mail replies, it is considered polite to post a summary.

* Don't post in HTML format. Many readers of this newsgroup don't use
newsreaders which can handle HTML postings.

* If you have to include source code in your post, include the
source in the message body. Don't use attachments. A lot
of contributors to this newsgroup won't even notice the existence
of attachments or won't open them. You try to get any help
you can get, don't you?

Some netiquette topics which frequently crop up on comp.lang.c++ are
also answered in the FAQ.

* Should I post job advertisements and/or resumes on comp.lang.c++?
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.10

* What if I really need a job; should I post my resume on comp.lang.c++?
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.11

* What should I do to someone who posts something off-topic?
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.12

A note on comp.lang.c++ etiquette: Accuracy is valued very highly in this
newsgroup; therefore posts are frequently corrected, sometimes perhaps
too harshly, and often to the annoyance of new posters who consider the
correction trivial. Do not take it personally; the best way to fit in
with comp.lang.c++ is to express gratitude for the correction, move on,
and be more careful next time.

This is a very busy group, so these requests are designed to make it as
pleasant and efficient an experience as possible. We hope it proves
a valuable commodity to you.

A list of some Newsgroups :
Languages and Programming
-------------------------
comp.lang.c The C Programming Language
comp.lang.asm.x86 x86 assembly language programming
comp.programming Non-language specific programming
comp.graphics.algorithms Issues of computer graphics

Operating Systems
-----------------
comp.os.msdos.programmer DOS, BIOS, Memory Models, interrupts,
screen handling, hardware
comp.os.ms-windows.programmer.win32 MS/Windows: Mice, DLLs, hardware
comp.os.os2.programmer.misc OS/2 Programming
comp.sys.mac.programmer.misc Macintosh Programming
comp.unix.programmer General Unix: processes, pipes, POSIX,
curses, sockets
comp.unix.[vendor] Various Unix vendors

Microsoft VC++
-------------
microsoft.public.vc.language VC++ issues
microsoft.public.vc.mfc MFC Issues
microsoft.public.dotnet.languages.vc C++/CLR Issues
microsoft.public.dotnet.framework .Net Framework


Borland C++ Builder
-------------------
borland.public.cppbuilder.language Borland C++ Builder
borland.public.cpp.language
borland.public.cppbuilder

-Shiva
http://www.slack.net/~shiva/welcome.txt


Wed Apr 29 12:30:00 EDT 2009


==============================================================================
TOPIC: Delegates ,smart pointers and GUI
http://groups.google.com/group/comp.lang.c++/t/f5ef7b3e0a822708?hl=en
==============================================================================

== 1 of 7 ==
Date: Wed, Apr 29 2009 10:11 am
From: Vincent R


Hi,

I am currently analyzing some GUI architecture and during my research I
found some implementations of delegates(closures) in C++.
Would it be something interesting to use in a GUI framework and in
particular for events ? If not could you give some explanations.


Another question is about smart pointers, I didn't see lots of GUI
frameworks using it ? Is there any reason ? Is it because generally
developpers use easy paradigm and prefers to use traditional methods or
is it more complicated than that?

Thanks


== 2 of 7 ==
Date: Wed, Apr 29 2009 10:20 am
From: ram@zedat.fu-berlin.de (Stefan Ram)


Vincent R <forumer@smartmobili.com> writes:
>delegates(closures)

A delegate usually is not a closure and vice versa.

>Would it be something interesting to use in a GUI framework and in
>particular for events ?

http://en.wikipedia.org/wiki/Event_model
http://google.to/search?q=delegation+event+model

== 3 of 7 ==
Date: Wed, Apr 29 2009 10:27 am
From: Phlip


Vincent R wrote:

> I am currently analyzing some GUI architecture and during my research I
> found some implementations of delegates(closures) in C++.
> Would it be something interesting to use in a GUI framework and in
> particular for events ? If not could you give some explanations.

Closures absolutely rock for GUIs. Look at Shoes:

http://shoooes.net/tutorial/

Shoes.app {
@push = button "Push me"
@note = para "Nothing pushed so far"

@push.click {
@note.replace "Aha! Click!"
}
}

You don't need a callback or a function pointer or an override to implement the
effect of clicking the button. You just write what you need inside a block.

Expect C++ to get blocks like that any decade now...

> Another question is about smart pointers, I didn't see lots of GUI
> frameworks using it ? Is there any reason ? Is it because generally
> developpers use easy paradigm and prefers to use traditional methods or
> is it more complicated than that?

Ogre3d, for example, lets you call 'new' to create a scene element, but when you
add it to the scene object that object assumes ownership, and will destruct the
element for you when it destructs. Because Views are always trees of owned
elements in container relationships. hiding the smart pointers inside the
container objects is more DRY.

--
Phlip


== 4 of 7 ==
Date: Wed, Apr 29 2009 10:35 am
From: Vincent R


Stefan Ram a écrit :
> Vincent R <forumer@smartmobili.com> writes:
>> delegates(closures)
>
> A delegate usually is not a closure and vice versa.
>
>> Would it be something interesting to use in a GUI framework and in
>> particular for events ?
>
> http://en.wikipedia.org/wiki/Event_model
> http://google.to/search?q=delegation+event+model
>
Thanks for your resources but all I can find describe what exists in
Java/.NET ... and how it works.
What I want is some feddback and experience, not just a theroy that
describes me how it works.
For instance I have found this article :
http://www.codeproject.com/KB/cpp/FastDelegate.aspx

And I wanted to know if it would be relevant to use it.


== 5 of 7 ==
Date: Wed, Apr 29 2009 11:58 am
From: "Phlip"


Vincent R wrote:

> Thanks for your resources but all I can find describe what exists in
> Java/.NET ... and how it works.
> What I want is some feddback and experience, not just a theroy that
> describes me how it works.
> For instance I have found this article :
> http://www.codeproject.com/KB/cpp/FastDelegate.aspx

A system that uses "smart" member function pointers _might_ be called a
"closure". I don't know exactly what the word means!

A member function pointer is really a "smart offset". It stores the location
and type of a member function so you can pick at runtime which one to call
on what object. Such an offset cannot "own" its target, so it can't be
"smart" in the meaning that "smart pointers" use.

The article then procedes to find a use for "delegates" implemented as
member function pointers. I can't read it, because I'm too spoiled by
dynamic languages that make all this plumbing much more easy!

But, yes, in general a View and a Model must decouple and communicate, using
a Controller as the "patch board" between them. Think of the Controller as
an old fashioned telephone operator, using big cords and plugs to finish
calls. The Controller must plug this or that data channel in, so the View
and Model can communicate. If a connection must change at runtime, you need
a pointer to re-point, so I can see how the FastDelegate system can help!

If you insist on writing your GUI in C++!

--
Phlip


== 6 of 7 ==
Date: Wed, Apr 29 2009 12:07 pm
From: Vincent R


Phlip a écrit :
> Vincent R wrote:
>
>> Thanks for your resources but all I can find describe what exists in
>> Java/.NET ... and how it works.
>> What I want is some feddback and experience, not just a theroy that
>> describes me how it works.
>> For instance I have found this article :
>> http://www.codeproject.com/KB/cpp/FastDelegate.aspx
>
> A system that uses "smart" member function pointers _might_ be called a
> "closure". I don't know exactly what the word means!
>
> A member function pointer is really a "smart offset". It stores the location
> and type of a member function so you can pick at runtime which one to call
> on what object. Such an offset cannot "own" its target, so it can't be
> "smart" in the meaning that "smart pointers" use.
>
> The article then procedes to find a use for "delegates" implemented as
> member function pointers. I can't read it, because I'm too spoiled by
> dynamic languages that make all this plumbing much more easy!
>
> But, yes, in general a View and a Model must decouple and communicate, using
> a Controller as the "patch board" between them. Think of the Controller as
> an old fashioned telephone operator, using big cords and plugs to finish
> calls. The Controller must plug this or that data channel in, so the View
> and Model can communicate. If a connection must change at runtime, you need
> a pointer to re-point, so I can see how the FastDelegate system can help!
>
> If you insist on writing your GUI in C++!
>

Why are you denigrating C++ if you follow a c++ newsgroup ... ;-)


== 7 of 7 ==
Date: Wed, Apr 29 2009 1:00 pm
From: "Phlip"


Vincent R wrote:

>> If you insist on writing your GUI in C++!

> Why are you denigrating C++ if you follow a c++ newsgroup ... ;-)

To show off my >20 years of experience with it.

Seriously: If I'm going to write anything low-level - anything with the name
"engine" or "server" in it - my first pick is C++. Not Objective C or Brand
X or some wannabe language.

This is different from posting "Perl sucks!" to a Perl newsgroup every day -
that's just trolling. But a lot of people come here believing the brochure,
and thinking C++ is good for this or that (the way some people think Lisp is
"good for artificial intelligence"). They need to be disabused of these
notions!

"Premature optimization is the root of all evil", and that rubric applies to
picking C++ first. To write a View, you don't need blazing performance. You
only need to respond to user actions within 1/10th of a second. To optimize
programmer time, you should use a language that supports dynamic typing and
block closures - like the Ruby sample I posted with Shoes. That was a
complete program, not a pseudocode!

All applications follow a pattern "alternate hard and soft layers". A
website, for example, could use a DB and web server written in C++, a soft
scripting language like Ruby for the hard parts (itself implemented in C),
SQL for the data queries, and HTML+JavaScript for the View. The parts that
must run fast use a hard language - C or C++ - and the parts that
programmers must change frequently run in a soft language.

So, in a soft language, the need for all this plumbing - smart pointers,
delegates, abstract base classes, etc. - goes away, and we can work faster.

--
Phlip

==============================================================================
TOPIC: Can't pinpoint linker error
http://groups.google.com/group/comp.lang.c++/t/ee34b2c94d37308d?hl=en
==============================================================================

== 1 of 2 ==
Date: Wed, Apr 29 2009 12:34 pm
From: Nick Overdijk


Hey guys,

MinGW GCC's linker is giving me these errors, and I can't really figure
out what they mean. Any help on this?

[errors]
Linking console executable: bin\Debug\Program.exe

obj\Debug\net.o: In function
`_ZNSt8_Rb_treeISsSt4pairIKSsSsESt10_Select1stIS2_ESt4lessISsESaIS2_EEC1ERKS6_RKS7_':
/include/c++/3.4.5/bits/allocator.h:(.bss+0x0): multiple definition of
`_settings'
obj\Debug\main.o:C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0):
first defined here

obj\Debug\service.o: In function
`_ZNSaISt13_Rb_tree_nodeISt4pairIKSsN4stfu4nodeEEEEC1IS4_EERKSaIT_E':
/include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0): multiple definition
of `_settings'
obj\Debug\main.o:C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0):
first defined here

obj\Debug\servicecontrol.o: In function
`_ZN9__gnu_cxx13new_allocatorISt4pairIKSsN4stfu4nodeEEED2Ev':
/include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0): multiple definition
of `_settings'
obj\Debug\main.o:C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0):
first defined here

obj\Debug\settings.o: In function
`_ZNSaISt4pairIKSsSsEEC1ISt13_Rb_tree_nodeIS1_EEERKSaIT_E':
/include/c++/3.4.5/bits/stl_tree.h:(.bss+0x0): multiple definition of
`_settings'
obj\Debug\main.o:C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0):
first defined here

obj\Debug\worm.o: In function
`_ZN9__gnu_cxx13new_allocatorISt4pairIKSsN4stfu4nodeEEED2Ev':
include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0): multiple definition of
`_settings'
obj\Debug\main.o:C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:(.bss+0x0):
first defined here
[/errors]

Thanks in advance,


== 2 of 2 ==
Date: Wed, Apr 29 2009 12:53 pm
From: Nick Overdijk


An extern in the header and the declaration in a definition and it was done.


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

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: