473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

outline

I feel the need for an outline specifier to
facilitate java-style programming.

Jul 19 '05 #1
10 3056
"Agent Mulder" <mb*******************@home.nl> wrote...
I feel the need for an outline specifier to
facilitate java-style programming.


There is no need in the language to do anything to emulate
any other language. What problem, otherwise unsolvable,
will 'outline' solve? If you can answer this question, post
your suggestion, with the justification, to comp.std.c++.

Victor
Jul 19 '05 #2
Agent Mulder wrote:
I feel the need for an outline specifier to
facilitate java-style programming.
...


Don't you think that C++ already suffered enough from "java-style
programming"? And that without even trying to facilitate it explicitly.

--
Best regards,
Andrey Tarasevich
Brainbench C and C++ Programming MVP

Jul 19 '05 #3
AM> I feel the need for an outline specifier to
AM> facilitate java-style programming.

VB> There is no need in the language to do anything to emulate
VB> any other language. What problem, otherwise unsolvable,
VB> will 'outline' solve? If you can answer this question, post
VB> your suggestion, with the justification, to comp.std.c++.

With java-style programming I mean that you
do away with the .cpp .h - pair of files. All
function definitions go directly in the class
declaration. The compiler honors this attempt
and generates very fast, yet big applications.
In order to slow my program down, I need some
functions to be expanded 'outline'
class Music
{
public:void init()
{
//1400 lines of initialization code (skipped)
for(;;); //this forces my compiler to *NOT* inline this function
}};
This leaves me with a warning message:
Warning W8027: Functions containing for are not expanded inline
I wave my hat and shout back "Never Mind!". But why not write
it like this:

class Music
{
public:outline void init()
{
//1400 lines of initialization code (skipped)
}};
to make sure the compiler takes it out of the class
definition while leaving the structure of the class intact.

-X

Jul 19 '05 #4
"Agent Mulder" <mb*******************@home.nl> wrote:
I feel the need for an outline specifier to
facilitate java-style programming.


Many compilers allow you to disable inlining of functions completely.
There is a discussion going on in comp.lang.c++.moderated (turn off
inlining using extern "C") exactly about the same subject, you might
want to join in there. I doubt that facilitating java-style programming
will convince many, however.

Just to satisfy my curiosity (not intended as criticism); if you prefer
Java style programming, why you don't just use Java? I think one of the
most important problems of Java programmers struggling to learn C++, is
realizing that C++ is really a different programming language with
different semantics and idioms, even though much of the syntax may seem
quite familiar at first. Encouraging to make C++ look more like Java
doesn't really help in this respect in my opinion

--
Peter van Merkerk
peter.van.merkerk(at)dse.nl


Jul 19 '05 #5
"Agent Mulder" <mb*******************@home.nl> wrote...
VB> Whatever.
That's not enough. [...]


Not enough for what? I don't want to continue this
discussion.
Jul 19 '05 #6
VB>I don't want to continue this discussion.
Why not? I only want you to notice
that I posted my suggestion for
'outline' on July 29, 2003 and the
suggestion for !inline by Francis
Glassborrow is from July 31, 2003.
Today! Only 2 hours ago, the e-ink
has not yet dried...

-X

go expand a macro, or backtrace something...
Jul 19 '05 #7


Agent Mulder wrote:

VB>I don't want to continue this discussion.

Why not?


I think Victor has the same feeling on this 'feature'
as I have:
It's pointless.
If I don't want a function to be inlined, well, then
simply don't write the function body in the class
decleration. Plain and simple. No special keyword
needed for that.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #8
KHB> I think Victor has the same feeling on this 'feature'
KHB> as I have:
KHB> It's pointless.
KHB> If I don't want a function to be inlined, well, then
KHB> simply don't write the function body in the class
KHB> decleration. Plain and simple. No special keyword
KHB> needed for that.

Modern compilers and linkers are smart enough
that they will inline everything they see fit, defined
inside or out of the class body. You can't trust on
that.

-X
Jul 19 '05 #9


Agent Mulder wrote:

KHB> I think Victor has the same feeling on this 'feature'
KHB> as I have:
KHB> It's pointless.
KHB> If I don't want a function to be inlined, well, then
KHB> simply don't write the function body in the class
KHB> decleration. Plain and simple. No special keyword
KHB> needed for that.

Modern compilers and linkers are smart enough
that they will inline everything they see fit, defined
inside or out of the class body. You can't trust on
that.


If the compiler deosn't see the source code,
it cannot inline it, simple.

But for the linker:
Do you know of any linker that does this?
I would be very surprised and make a deep bow
in front of the guys who managed to do that.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #10
AM > I feel the need for an outline specifier [...]

KHB> If I don't want a function to be inlined, well, then
KHB> simply don't write the function body in the class
KHB> decleration. Plain and simple. No special keyword
KHB> needed for that.

AM> Modern compilers and linkers are smart enough
AM> that they will inline everything they see fit, defined
AM> inside or out of the class body.

KH> If the compiler deosn't see the source code,
KH> it cannot inline it, simple.
KH>
KH> But for the linker:
KH> Do you know of any linker that does this?
KH> I would be very surprised and make a deep bow
KH> in front of the guys who managed to do that.

I copied this reply from from the thread
Re: turn off inlining using extern "C", on
comp.lang.c++.moderated:

Heinz Ozwirk:
If you want to prevent functions from being inlined, put them in separate
.cpp (or whatever) files and only include their prototypes in the code
that calls them. The compiler cannot inline them, if it doesn't know what
to inline.


Francis GlassBorow:
Of course it can and good linkers have been managing that for some time.
In future it will become more common as forms of semi-compiled code
become more common. VC++7 has some quite clever features in this area.

//Agent Mulder again:
The conclusion in that thread is that there is no
portable way to ensure that code gets expanded
outline (not inline). It is viewed as a de-optimization
enforced by the programmer. Your hack of taking
the function body out of the class declaration does
not work. Fix it.

-X
Jul 19 '05 #11

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

Similar topics

4
by: Doors of Perception | last post by:
As you probably know, when you click on a link in MSIE and go to a page, then when you click the "back" button, you see a dotted box outlining the link on which I just clicked. As far as I'm...
20
by: Chris Bradbury | last post by:
Hi, I'm posting in this forum for the first time so if I break any conventions or protocols I'm sorry. I've attached this style: *:focus { outline: none } to a page but it doesn't remove...
6
by: Altramagnus | last post by:
I have n number of circles. Some of them might overlap. I need to draw the outline of all circles but not those overlap areas. Initially, I am try to use a Region, because a Region object has a...
5
by: Felix Collins | last post by:
Hi All, does anyone know any cleaver tricks to sort a list of outline numbers. An outline number is a number of the form... 1.2.3 they should be sorted in the following way... 1 1.1 1.2
1
by: John Doe | last post by:
I collapse an outline block, then copy it, then paste it. In my experience, the outline block always expands after the paste. Is their a way to modify the editor's behavior so that an outline block...
3
by: msnews.microsoft.com | last post by:
Anyone ever play with Outline views in VS.NET? I'm amazed I never discovered this. None of this was ever discussed in my training. It's a big help to use this with HTML view. View/Synchronize...
13
by: deko | last post by:
I. A. B. II. A. 1) 2) B. C.
4
by: Rex | last post by:
Hi - I am new to VB.Net/2005, but not VB. I am trying to find an outline or tree - type control for VB.Net/2005 that provides the ability for the User to TYPE in one of the NODES of the outline......
2
by: Joel Byrd | last post by:
I want to get a red outline around different divs on a page when I hover the mouse over them, and then have the red outline disappear on mouse out (basically to indicate that various elements on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.