2 2149
I changed ytour code to this: -
///////////////////////////////////////////////////
-
class Message
-
{
-
-
};
-
-
/////////////////////////////////////////////////
-
namespace virtos
-
{
-
namespace threading
-
{
-
-
template <class T>
-
class ThreadSafeObject
-
{
-
public:
-
ThreadSafeObject ();
-
-
ThreadSafeObject (const ThreadSafeObject<T>& copy);
-
~ThreadSafeObject ();
-
-
void Get ();
-
-
void Set (T to);
-
-
ThreadSafeObject<T>& operator = (const ThreadSafeObject<T>& rhs);
-
-
ThreadSafeObject<T>& operator = (const T& rhs);
-
-
operator T ();
-
-
private:
-
T m_data;
-
//RwMutex* m_tsafety;
-
};
-
-
}
-
}
-
-
-
//////////////////////////////////////////////
-
namespace virtos
-
{
-
namespace ipc
-
{
-
-
class MessageHandler
-
{
-
public:
-
MessageHandler (bool block = true);
-
virtual ~MessageHandler ();
-
-
bool BlocksMsg ();
-
void BlockMsg (bool block = true);
-
-
virtual bool TestMsg (const Message&) = 0;
-
virtual void HandleMsg (const Message&) = 0;
-
-
protected:
-
threading::ThreadSafeObject<bool> m_blocksMsg;
-
};
-
-
}
-
}
-
///////////////////////////////////////////////////////////////////
-
-
-
int main()
-
{
-
return 0;
-
}
-
and it compiles with no warnings and no errors using Visual Studio.NET 2005.
Are you using the -pedantic switch on g++? That sets the compiler to strict ANS/ISO C++.
Thanks, but I was able to fix (or "work around" is probably the more correct term) the problem by switching the order of the includes in unit-dev.cpp. It's odd that that would fix it, because there are no duplicate #includes for any files relating to ThreadSafeObjec t (I know for sure, I modelled them graphically).
Thanks anyway :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Matthew Del Buono |
last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm
just curious as to whether this is Microsoft's problem in their compiler or
if there's a standard saying this is to be true (not necessarily an internal
compiler error, but still an error)
This may just a bit OT, but I decided to post it here instead of Microsoft
because my question is more directed towards standards...
Of course, any other day I would have...
|
by: Shlomi |
last post by:
Hi !
I've wrote quite a big code which bases on a considerable large amount
of template classes. (uses many different kinds of each template
class).
Now, without prior knowledge of mine, it turns out that this code
should
be compiled with compiler which doesn't support templates ! (OUCH!)
|
by: Hafeez |
last post by:
I am having real trouble compiling this code
http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz
The attachment shows errors when compiled using the current version of
g++ in a i386-pc-solaris2.9.
Seeing reference to gcc-2.7.2 in the Makefile of the code, I
downloaded it and compiled in my home directory. Then changed the
referenes of LIBDIR and INCLUDES to
this installation .and ran with g++ for 2.7.2 then there are still...
|
by: Mark Dufour |
last post by:
After nine months of hard work, I am proud to introduce my baby to the
world: an experimental Python-to-C++ compiler. It can convert many
Python programs into optimized C++ code, without any user intervention
such as adding type declarations. It uses rather advanced static type
inference techniques to deduce type information by itself. In
addition, it determines whether deduced types may be parameterized,
and if so, it generates...
|
by: pj |
last post by:
(Was originally, probably wrongly, posted to the vc subgroup.)
(This doesn't appear to be a c# problem, but a problem with a bug in
the Visual Studio c# compiler, but, any help will be welcome...)
Oh, I forgot to list the error messages; I would be delighted if
someone could explain how to deduce which line number in which file is
the one that the VC compiler cannot handle. Actually I'm using C#, but
the only post I could find about...
| |
by: Steve |
last post by:
I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu...
|
by: Chameleon |
last post by:
This code below compiles fine with VS.2005 but with gcc 3.4.2 not.
------------------
template<class T>
static void Wastage1D::clever_erase(vector<T> &v, vector<typename
vector<T>::iterator> &its, vector<T> &vo)
{ ........ }
------------------
I run gcc like this:
gcc -c wastage1d.cpp
|
by: Miroslaw Makowiecki |
last post by:
Where can I download Comeau compiler as a trial version?
Thanks in advice.
|
by: tropos |
last post by:
I'm trying to use the 'typedef templates' idiom, mentioned in
Alexandrescu's work on templates. Here's a Dr Dobbs article from 2002
that says they are a proposed C++ standard:
http://www.ddj.com/cpp/184403850
My compiler (Visual Age C 6.0) rejects them. Are they supported? Were
they ever introduced into the language standard?
Here is an example:
|
by: Alex Vinokur |
last post by:
Hi,
I have compilation problem on SUN CC compiler with template while
using option -m64 (64-bit addressing model).
No problem while using option -m32 (32-bit addressing model)
$ CC -V
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
|
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,...
| |
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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...
| |
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |