• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gcc 4.0 compiling error ( from CW to XCode )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 4.0 compiling error ( from CW to XCode )


  • Subject: Re: gcc 4.0 compiling error ( from CW to XCode )
  • From: Jonathan Prescott <email@hidden>
  • Date: Wed, 11 Jun 2008 16:18:10 -0400

It supports template<>. Is the template definition within the namespace std declaration? It's not clear from your code snippet. If not, that's your problem, the char_traits specialization doesn't have the general template definition (std::char_traits) from which to specialize. However, if it is, I've sometime had to specify the fully qualified name of the template class in other circumstances when using the gcc std. library implementation (not just on Mac OSX, by the way, but, also under Linux and Cygwin). There are probably still some bugs in the namespace resolution logic in the compiler (and the Std Library tends to really wring out the template/namespace/ etc. components of the compiler). So, I would try using "template<> struct std::char_traits<clueless>", or even "template<> class std::char_traits<clueless>", to match what is in the std. library header.

Jonathan

On Jun 11, 2008, at 7:54 AM, Robert Welz wrote:d

just beeing curious, can it be that template <> is not supported by gcc 4.0?





Am 11.06.2008 um 13:05 schrieb Robert Welz:
The code is as follows:

//	Case insensitive strings & chars

#ifndef CASELESS_H
#define CASELESS_H

#include <string>
#include "SetupArch.h"

namespace std {

#if defined  CompilingForPosix || defined CompilingForWin32
	typedef char caseless;
#else

//#include "Utils/noalign.h"
#include "/Source/Grand Central Pro/GrandCentral/Develop/Common/ HOSAL/Utils/noalign.h"


struct caseless {
	char	c;

	caseless () : c(0) {}
	caseless (char ch) : c(ch) {}
	caseless (char* ch) : c(*ch) {}
	operator char()
		{ return c; }
	operator const char() const
		{ return c; }
	operator const char*() const
		{ return (const char*)&c; }
//	operator int()
//		{ return (int) c; }
};

//#include "Utils/realign.h"
#include "/Source/Grand Central Pro/GrandCentral/Develop/Common/ HOSAL/Utils/realign.h"


// char_traits<char>

template <>
struct char_traits<caseless>
{
	typedef caseless	char_type;
	typedef int         int_type;
	typedef streamoff   off_type;
	typedef streampos   pos_type;
	typedef mbstate_t   state_type;

	static void assign(char_type& c1, const char_type& c2);
	static bool eq(const char_type& c1, const char_type& c2);
	static bool lt(const char_type& c1, const char_type& c2);

static int compare(const char_type* s1, const char_type* s2, size_t n);
static size_t length(const char_type* s);
static const char_type* find(const char_type* s, size_t n, const char_type& a);
static char_type* move(char_type* s1, const char_type* s2, size_t n);
static char_type* copy(char_type* s1, const char_type* s2, size_t n);
static char_type* assign(char_type* s, size_t n, char_type a);


	static int_type not_eof(const int_type& c);
	static char_type to_char_type(const int_type& c);
	static int_type to_int_type(const char_type& c);
	static bool eq_int_type(const int_type& c1, const int_type& c2);
	static int_type eof();
};

// Implementation: char_traits<char>

template <>
inline
void
char_traits<caseless>::assign(char_type& c1, const char_type& c2)
{
	c1 = c2;
}



Thank you very much for some help.

BTW is there literature about changes in C++ which can be recommended?

Robert





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40pro2col.de


This email sent to email@hidden


--- Robert Welz Pro2col Limited Weinheimer Strasse 64 D-68309 Mannheim

t  0621 724 5837
f  0621 724 5782
w  http://www.pro2col.de
e  email@hidden
skype  ro.welz

Pro2col Technischer Support
email@hidden
Tel.: +49 621 724 5837


Apple Solution Expert - Print & Publishing

File transfer & workflow specialists for the graphic art & prepress industry

Distributors for DevZeroG, Hermstedt & OneVision within the UK and Ireland

Pro2col's legal position regarding Internet communications can be found at http://pro2col.com/about/legal.asp





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >gcc 4.0 compiling error ( from CW to XCode ) (From: Robert Welz <email@hidden>)
 >Re: gcc 4.0 compiling error ( from CW to XCode ) (From: Robert Welz <email@hidden>)

  • Prev by Date: Re: Compiler error when handling C++ std::string class variable
  • Next by Date: Error on compile
  • Previous by thread: Re: gcc 4.0 compiling error ( from CW to XCode )
  • Next by thread: Debugger enters __dyld_stub_binding_helper*
  • Index(es):
    • Date
    • Thread