473,854 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Boost process and C

Hi,

Is there any group in the manner of the C++ Boost group that works on
the evolution of the C language? Or is there any group that performs an
equivalent function?

Thanks,
-vs

Apr 29 '06
335 11957
I said:

Multiplication needs TWO operators.


It should have been

Multiplication needs TWO operands.

Sorry for this stupid bug :-)

May 1 '06 #131
jacob navia wrote:
Ian Collins a écrit :

That's why we have const. If a function isn't going to change the value
passed in, it should reference (or pointer) to a const object. If the
parameter isn't const, assume the worst. No difference between pointers
and references in this case.

lcc-win32 will COPY the argument into the stack ALWAYS when the function
prototype specifies a structure passed by value.

typedef struct {int a; int b;} Struct;

Struct someGlobal;

void fn(Struct);

int main(void)
{
Struct &a = someGlobal;

fn(a);
...
}

The call to fn(a) will provoke a dereferencing of a, and a copy of the
result of that dereferencing into the stack.

This means that even if you do NOT have any "const" declaration the
prototype specifications are ALWAYS followed.

This makes for clearer software. Otherwise you can effectively never
know if a function will change its argument!

I'm not sure what you are saying, the above describes normal pass by
value in C, I was answering a question about pass by reference....

--
Ian Collins.
May 1 '06 #132
jacob navia wrote:
Ian Collins a écrit :
Richard Bos wrote:
jacob navia <ja***@jacob.re mcomp.fr> wrote:

Richard Bos a écrit :
> Operator overloading... yeurgh. What does random_struct_x *=
> random_union_y + random_integer_ z; _do_ in the first place?
int128 operator*=(int1 28 a,int128 b);

Well that should multiply a*b and assign the result to a, returning a,
I suppose. What is so weird about that?

That's not overloading. In a real C compiler, those would be int_128t's,
a normal integer type, and the normal C arithmetic operations would
apply to them.


Also *= is a unary operator, so the syntax looks clumsy.

Multiplication needs TWO operators. In C++ you have the "implicit this".
In C you don't have any implicit arguments so you need a different
prototype.

Very true, but how would you invoke the operator you prototype above?

--
Ian Collins.
May 1 '06 #133
Ian Collins a écrit :
jacob navia wrote:
Ian Collins a écrit :

That's why we have const. If a function isn't going to change the value
passed in, it should reference (or pointer) to a const object. If the
parameter isn't const, assume the worst. No difference between pointers
and references in this case.


lcc-win32 will COPY the argument into the stack ALWAYS when the function
prototype specifies a structure passed by value.

typedef struct {int a; int b;} Struct;

Struct someGlobal;

void fn(Struct);

int main(void)
{
Struct &a = someGlobal;

fn(a);
...
}

The call to fn(a) will provoke a dereferencing of a, and a copy of the
result of that dereferencing into the stack.

This means that even if you do NOT have any "const" declaration the
prototype specifications are ALWAYS followed.

This makes for clearer software. Otherwise you can effectively never
know if a function will change its argument!


I'm not sure what you are saying, the above describes normal pass by
value in C, I was answering a question about pass by reference....


Excuse me. I was just saying that passing a reference to a function that
accepts a structure VALUE does NOT force a pass by reference. To pass by
reference you have to write:

void fn(STRUCT &);

ONLY then, a pass by reference is done.
May 1 '06 #134
Ian Collins a écrit :
jacob navia wrote:
Ian Collins a écrit :

Richard Bos wrote:
jacob navia <ja***@jacob.re mcomp.fr> wrote:


>Richard Bos a écrit :
>
>
>
>>Operato r overloading... yeurgh. What does random_struct_x *=
>>random_un ion_y + random_integer_ z; _do_ in the first place?
>
>
>int128 operator*=(int1 28 a,int128 b);
>
>Well that should multiply a*b and assign the result to a, returning a,
>I suppose. What is so weird about that?

That's not overloading. In a real C compiler, those would be int_128t's,
a normal integer type, and the normal C arithmetic operations would
apply to them.
Also *= is a unary operator, so the syntax looks clumsy.

Multiplicatio n needs TWO operators. In C++ you have the "implicit this".
In C you don't have any implicit arguments so you need a different
prototype.


Very true, but how would you invoke the operator you prototype above?

Just
int128 a,b,c;
...
a *= b;
May 1 '06 #135
jacob navia wrote:

Substantive discussions about software constructions, pro/cons of
specific ways of writing in C, or discussions about the language itself
and its direction, new proposals etc, are

"beyond the scope of this group".

Everything is frozen here, like in a museum.

There are similar issues on the C++ group, but the biggest difference is
there is always somewhere else for OT discussions to migrate to.

--
Ian Collins.
May 1 '06 #136
jacob navia wrote:
Ian Collins a écrit :
I'm not sure what you are saying, the above describes normal pass by
value in C, I was answering a question about pass by reference....


Excuse me. I was just saying that passing a reference to a function that
accepts a structure VALUE does NOT force a pass by reference. To pass by
reference you have to write:

void fn(STRUCT &);

ONLY then, a pass by reference is done.


Ah, I see. That is how it should be.

--
Ian Collins.
May 1 '06 #137
jacob navia <ja***@jacob.re mcomp.fr> writes:
Keith Thompson a écrit :
comp.lang.c++ in effect tried a similar experiment some years ago. It
barely survived. As it drowned in a flood of discussions of
system-specific C++ programming, the regulars who wanted to talk about
the language itself drifted away.


But that's the point Keith. We want to talk ABOUT THE LANGUAGE ITSELF.


If you just wanted to talk about the language itself, I wouldn't have
any problem.

The language itself doesn't have operator overloading, yet you insist
on talking at length about operator overloading.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 1 '06 #138
Keith Thompson wrote:
jacob navia <ja***@jacob.re mcomp.fr> writes:
Keith Thompson a écrit :
comp.lang.c+ + in effect tried a similar experiment some years ago. It
barely survived. As it drowned in a flood of discussions of
system-specific C++ programming, the regulars who wanted to talk about
the language itself drifted away.


But that's the point Keith. We want to talk ABOUT THE LANGUAGE ITSELF.

If you just wanted to talk about the language itself, I wouldn't have
any problem.

The language itself doesn't have operator overloading, yet you insist
on talking at length about operator overloading.

Keith,

Where would you draw the line on topicality?

My interpretation is

Off topic:

Platform specific issues.
Product specific issues.

On topic:

The current language and its use.
Potential improvements?

--
Ian Collins.
May 1 '06 #139
Ian Collins <ia******@hotma il.com> writes:
[...]
Keith,

Where would you draw the line on topicality?

My interpretation is

Off topic:

Platform specific issues.
Product specific issues.

On topic:

The current language and its use.
Potential improvements?


I would say that potential improvements *would be* topical here if it
weren't for the existence of comp.std.c.

Discussions of potential improvements are off-topic if they're a thin
disguise for advertisements for some specific compiler that happens to
implement them as an extension.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 1 '06 #140

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
5408
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory manipulation. Those wise people that created it did not take care of it. So, BOOST is a portable...
205
10771
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
17
1906
by: Howard Gardner | last post by:
/* If I am using boost, then how should I write this program? As it sits, this program is using SFINAE to determine whether or not a type supports particular syntax. I suspect that there is functionality in boost to do this. I have found mpl::has_xxx, which I suspect of being part of the solution. I've also found type_traits::has_nothrow_constructor
2
6636
by: smith4894 | last post by:
{ not sure you're aware of that but there are the newsgroups for all major operating systems. you might want to try asking in the forum 'comp.os.linux.development.apps', since memory-mapped files are not a language-supported structure, they are platform-specific. -mod } I'm trying to use boost serialization to serialize/deserialize data to and from a mmap'd file. I have my own ostream/istream classes that essentially read/write bytes...
5
2400
by: linyanhung | last post by:
I used a boost multi thread in VS 2005 on a Duo Core PC, and made a two thread process. The code is something like this: #include <boost/thread/thread.hpp> void fun1() { //do something
8
6216
by: Matt England | last post by:
My team currently using Boost Threads, but we are considering switching to ZThreads. (We seek cross-platform, C++ multithreading capabilities in an external library.) ZThread(s): http://zthread.sourceforge.net/ http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/ Can anyone share their ZThreads experience, either good, bad, or
2
2417
by: ironpingwin | last post by:
Hi! I'd like to make few threads which will run in the same time in C++. I try to use boost library v 1.34.1 (it can't be newest, because I compile on remote machine, which is not administrated by me). In this version there isn't detach() function. How to run functions from two different class in the same time?
13
4542
by: brad | last post by:
Still learning C++. I'm writing some regex using boost. It works great. Only thing is... this code seems slow to me compared to equivelent Perl and Python. I'm sure I'm doing something incorrect. Any tips? #include <boost/regex.hpp> #include <iostream> // g++ numbers.cpp -o numbers -I/usr/local/include/boost-1_35 /usr/local/lib/libboost_regex-gcc41-mt-s.a // g++ numbers.cpp -o numbers.exe
5
3596
by: ameyav | last post by:
Hi All, I am converting some C code into C++ code. The objective is to improve throughput. I have some code written in C which serially parses through a list of files, opens each one of them, processes the data and closes the file. All the files are processed one by one. The obvious performance bottleneck that i could think of is the wasted cpu cycles for file i/o. *My solution* was to spawn multiple threads to do the file i/o. For...
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9517
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4563
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.