Click here to Skip to main content
15,909,605 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Help! Program not working in 'Release mode' but works in 'Debug mode' Pin
slimtim18-Nov-08 18:51
slimtim18-Nov-08 18:51 
QuestionReporting application Pin
kasi1429-Oct-08 11:27
kasi1429-Oct-08 11:27 
AnswerRe: Reporting application Pin
Richard Andrew x6429-Oct-08 12:21
professionalRichard Andrew x6429-Oct-08 12:21 
QuestionImplicit type casts, is this possible Pin
mike toon28-Oct-08 5:04
mike toon28-Oct-08 5:04 
AnswerRe: Implicit type casts, is this possible Pin
Mark Salsbery28-Oct-08 6:33
Mark Salsbery28-Oct-08 6:33 
GeneralRe: Implicit type casts, is this possible [modified] Pin
mike toon29-Oct-08 1:36
mike toon29-Oct-08 1:36 
GeneralRe: Implicit type casts, is this possible Pin
Mark Salsbery29-Oct-08 5:22
Mark Salsbery29-Oct-08 5:22 
GeneralRe: Implicit type casts, is this possible Pin
mike toon30-Oct-08 0:52
mike toon30-Oct-08 0:52 
Yeah. Sorry i didn't communicate that well. Your code works and compiles fine.
I think i've figured out the problem, but not entirely sure why it occurs.
In addition to the cast overloads i also have an assignment overlaod which uses a template.
If i remove this template then it compiles fine, however with the template it causes the said error.

using namespace System;

ref class Value
	{
		public:

			enum struct ValType
			{
				Empty,
				Bool,
				Double,
				Integer
			};

			Value();

			Value^ operator=( Value^ rhs );
			
			Value( bool value );
	
			Value( double value );
				
			Value^ operator=( double doubVal );

			Value^ operator=( bool boolVal );

			template<typename t="">
			Value^ operator=( T value )
			{
				m_type   = ValType::Integer;
				m_value  = static_cast<int>( value );
				return this;
			}

			operator double( );

			operator bool( );
				
		private:

			Object^	m_value;
			ValType m_type;

	};</int></typename>


Any ideas why this compilation error occurs?

Many thanks,

mike.
GeneralRe: Implicit type casts, is this possible Pin
mike toon30-Oct-08 6:03
mike toon30-Oct-08 6:03 
GeneralRe: Implicit type casts, is this possible Pin
led mike30-Oct-08 6:13
led mike30-Oct-08 6:13 
GeneralRe: Implicit type casts, is this possible [modified] Pin
Mark Salsbery30-Oct-08 9:08
Mark Salsbery30-Oct-08 9:08 
GeneralRe: Implicit type casts, is this possible Pin
mike toon30-Oct-08 23:52
mike toon30-Oct-08 23:52 
QuestionI need help 1 items on the program administrators: (run on DOS) Pin
qt_oct26-Oct-08 19:22
qt_oct26-Oct-08 19:22 
AnswerRe: I need help 1 items on the program administrators: (run on DOS) Pin
Paul Conrad27-Oct-08 4:55
professionalPaul Conrad27-Oct-08 4:55 
AnswerCP IGNORE: homework Pin
leckey27-Oct-08 10:05
leckey27-Oct-08 10:05 
QuestionIncrementally convert existing native MFC Application to .NET Pin
Rolf Kristensen24-Oct-08 14:16
Rolf Kristensen24-Oct-08 14:16 
AnswerRe: Incrementally convert existing native MFC Application to .NET Pin
StevenS_Dev28-Oct-08 4:35
StevenS_Dev28-Oct-08 4:35 
GeneralRe: Incrementally convert existing native MFC Application to .NET [modified] Pin
Rolf Kristensen28-Oct-08 5:10
Rolf Kristensen28-Oct-08 5:10 
Questionconst char* to char* conversion Pin
auralius manurung23-Oct-08 20:10
auralius manurung23-Oct-08 20:10 
AnswerRe: const char* to char* conversion Pin
Mark Salsbery23-Oct-08 20:23
Mark Salsbery23-Oct-08 20:23 
AnswerRe: const char* to char* conversion Pin
KarstenK23-Oct-08 21:10
mveKarstenK23-Oct-08 21:10 
GeneralRe: const char* to char* conversion Pin
auralius manurung23-Oct-08 22:24
auralius manurung23-Oct-08 22:24 
Questioncreate a property with class type (class name is : system::io::ports:serialport) Pin
iman_kh21-Oct-08 22:05
iman_kh21-Oct-08 22:05 
QuestionRe: create a property with class type (class name is : system::io::ports:serialport) Pin
Mark Salsbery22-Oct-08 5:50
Mark Salsbery22-Oct-08 5:50 
AnswerRe: create a property with class type (class name is : system::io::ports:serialport) Pin
N a v a n e e t h22-Oct-08 18:15
N a v a n e e t h22-Oct-08 18:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.