Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers LCC > Re: why cant fu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1039 of 1062
Post > Topic >>

Re: why cant functions return arrays

by Ben Bacarisse <ben.usenet@[EMAIL PROTECTED] > Apr 22, 2008 at 12:50 AM

jacob navia <jacob@[EMAIL PROTECTED]
> writes:

> Ben Bacarisse wrote:
>>  Maybe I missed the do***ent you mean.
>>
> http://www.q-software-solutions.de/~jacob/
> There you will find a link to the specifications.

Ah, yes.  That says a little more but not really enough.  For example
I don't see anything about not allowing

  T &operator=(T&, T&);

lcc-win32 seems to reject

  T &operator=(T&, T*);

but that is not explained.  Is that a problem with the compiler or the
specification?

How many times is operator= called in these cases:

  T &operator=(T& x, int i) { ... }

  T a1[5] = {1,2};
  T a2 = {3};
  (T[2]){1,2};

  struct S { T t; };
  S s1 = {1};
  S s2 = {.x = 2};
  S as[5] = {1,2};

Is the following permitted:

  const T x = 42;
  x = 43;

The compiler allows it but the specifications says nothing about it.

What is the meaning of a pointer argument?  What does the remark
"References can be replaced by arrays of length 1." mean?

After reading the specification, I have more questions than when I
started.

> It would be very good for everybody if you would develop them
> with me.

We disagree to much.  I've already said I think it is a mistake to
consider initialisation as the same as assignment, for example.  I
think we just see thing far too differently.

-- 
Ben.
 




 2 Posts in Topic:
Re: why cant functions return arrays
Ben Bacarisse <ben.use  2008-04-22 00:50:49 
Re: why cant functions return arrays
jacob navia <jacob@[EM  2008-04-22 10:30:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 14:29:18 CDT 2008.