473,396 Members | 1,915 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,396 software developers and data experts.

Function Bodies in Header File

Hi,

In a C++/CLR Windows Forms app I notice that there is only a header and no
..cpp for the form. Also event handler bodies are added by the IDE right to
the header.

What is the philosophy on this?

1. Are C++ and/or C++/CLR classes now intended to be typically implemented
in the header?

2. Is this only for GUI and related?

3. Will functions be inlined by default?

4. Any issues with using a header for derived classes? What about exposing
potential IP functionality beyond just prototypes? Is the idea that for C++
with .NET that assembly references/namespaces will be used to expose class
members to clients i.e. headers no longer the primary means of class member
exposure for C++ using .NET Framework?

5. Any recommendations about function bodies in headers?

Thank You
--
Greg McPherran
www.McPherran.com
Jan 22 '06 #1
1 1410
Greg wrote:
Hi,

In a C++/CLR Windows Forms app I notice that there is only a header
and no .cpp for the form. Also event handler bodies are added by the
IDE right to the header.

What is the philosophy on this?

1. Are C++ and/or C++/CLR classes now intended to be typically
implemented in the header?
When created by the wizards, yes. The wizards were designed for C# and VB
and can't handle the header/implementation model typically used for C++.

2. Is this only for GUI and related?
You can use it for any classes you wish, but it's typically only found in
wizard-generated classes.

3. Will functions be inlined by default?
Yes.

4. Any issues with using a header for derived classes? What about
exposing potential IP functionality beyond just prototypes? Is the
idea that for C++ with .NET that assembly references/namespaces will
be used to expose class members to clients i.e. headers no longer the
primary means of class member exposure for C++ using .NET Framework?
Yes.

5. Any recommendations about function bodies in headers?


Leave the bodies of wizard generated classes in the headers. On your own
classes, use whatever style you prefer.

-cd
Jan 22 '06 #2

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

Similar topics

0
by: Chuck Amadi | last post by:
fp = file("/home/chuck/pythonScript/testbox") mbox = mailbox.UnixMailbox(fp, email.message_from_file) # list of body messages. bodies = # mail is the file object for mail in mbox: print...
6
by: Sharon | last post by:
Usually it is common to write the class member function in the class H file, but some people like to write the function body in the C++ file. Can anybody tell me what are the cases where inline...
7
by: Csaba Gabor | last post by:
I feel like it's the twilight zone here as several seemingly trivial questions are bugging me. The first of the following three lines is a syntax error, while the last one is the only one that...
21
by: Chen ShuSheng | last post by:
Hey, In head file 'stdio.h', I only find the prototype of these two function but no body. Could someone pls tell me where their bodies are ? -------------- Life is magical.
7
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
1
by: Claire | last post by:
I'm writing an internal mail system module for an application. The mails are stored on a sql database that may be on a LAN or WAN. The gui has similar functionality to most email systems where...
7
by: lovecreatesbea... | last post by:
Shoud we declare non-pointer function parameters with const keywords? int main(void){ int f(const int i); int i; f(i); return 0; }
8
by: Yakov | last post by:
I'd like a tool that performed inlining of function bodies of which do not appear in the .h file. Really. gcc on Linux. Yakov
5
by: inmatarian | last post by:
I sometimes see, particularly in wxWidgets, member function bodies inside of header files. They're never all that long, and it's usually just constructors and occasional accessors. Question is,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.