|
by: Oplec |
last post by:
Hi, I am trying to figure out the correct syntax for declaring a friend
function in a class template and then defining that member after the
class. The code example below is what I am trying to get to work
properly; it generates a link error.
Thank you, Oplec.
#include <cstdlib>
|
by: Hans De Winter |
last post by:
Why does my compiler complain with the message "`int*My::Test::_shape'
is private" when I try to compile the following code? It seems it has
something to do with the namespace since when I leave that out then
everything works fine.
Many thanks for your help.
Hans
// START CODE
#include <iostream>
|
by: Adam Parkin |
last post by:
Hello, all I'm having a problem with friend functions in a templatized Queue
class I'm writing using linked lists. The problem is that I can't get the
friend function to be able to access private data from the class. Here's
the gist of the code:
template <class T>
struct NodeType
{
T data;
NodeType<T> * link;
|
by: Neelesh |
last post by:
I was reading TC++PL (Chapter 11, section 11.5.1 "finding friends")
where it is mentioned that
What I observe is a bit different - it is fine that there is an error
for Xform, but the reason is not that Xform is not in scope - the
reason is that the class's size is not known.
Also, the second line is compiling fine - without any problems....
|
by: Gerard Stafleu |
last post by:
I have a project with the following module:
Module mdlDeclarations
Public Enum getMethod
gmFirst
gmLast
End Enum
End Module
and the following class:
|
|
by: gw7rib |
last post by:
Suppose I have a function, whose protoype is somewhat complicated, for
example, with some #defines and typedefs, it looks like this:
INT_PTR CALLBACK PropDlgProc(HWND hDlg, UINT message, WPARAM wParam,
LPARAM lParam);
and I'm not allowed to make it a member function <OTbecause it's a
dialog box function </OT>.
I want to make it a...
|
by: curious2007 |
last post by:
Hello everybody,
When I try to declare nontemplate friend functions I get the following warning:
friend decleration......declares a non-template function
(if this is not what you intended, make sure the function tempate has already been declared and add<> after the function name here)-Wno-non-template-friend disables this warning.
...
|
by: Rahul |
last post by:
Hi Everyone,
The following code works fine,
class A
{
private: friend void sample(A& obj)
{
printf("in friend...\n");
printf("%d",obj.i);
|
by: nooriddeen88 |
last post by:
is it possible for a "friend" function to return a "this" pointer?
|
by: mojmir |
last post by:
hello,
i have problem with following code (see below). compiler (vs2005sp1)
complains
that the call to fn is ambiguous:
error C2668: 'BB::fn' : ambiguous call to overloaded function
could be 'void BB::fn<dummy>(T &,BB::foo &)'
or 'void AA::fn<dummy>(T &,BB::foo &)'
okay, i have said, and tried to be more specific about the namespace
|
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...
|
|
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...
|
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. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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...
|
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...
|
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...
|
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|