|
-
Dec 29th, 2001, 01:30 PM
#1
Thread Starter
transcendental analytic
very funny MSVC compiler
GREAT!
Well it's time again for xlocale(467) : fatal error C1001: INTERNAL COMPILER ERROR, at the bolded line 
Code:
template<class _E>
class ctype : public ctype_base {
public:
typedef _E char_type;
bool is(mask _M, _E _C) const
{return (do_is(_M, _C)); }
const _E *is(const _E *_F, const _E *_L, mask *_V) const
{return (do_is(_F, _L, _V)); }
const _E *scan_is(mask _M, const _E *_F,
const _E *_L) const
{return (do_scan_is(_M, _F, _L)); }
const _E *scan_not(mask _M, const _E *_F,
const _E *_L) const
{return (do_scan_not(_M, _F, _L)); }
_E tolower(_E _C) const
{return (do_tolower(_C)); }
const _E *tolower(_E *_F, const _E *_L) const
{return (do_tolower(_F, _L)); }
_E toupper(_E _C) const
{return (do_toupper(_C)); }
const _E *toupper(_E *_F, const _E *_L) const
{return (do_toupper(_F, _L)); }
_E widen(char _X) const
{return (do_widen(_X)); }
const char *widen(const char *_F, const char *_L,
_E *_V) const
{return (do_widen(_F, _L, _V)); }
char narrow(_E _C, char _D = '\0') const
{return (do_narrow(_C, _D)); }
const _E *narrow(const _E *_F, const _E *_L, char _D,
char *_V) const
{return (do_narrow(_F, _L, _D, _V)); }
static locale::id id;
explicit ctype(size_t _R = 0)
: ctype_base(_R) {_Init(_Locinfo()); }
ctype(const _Locinfo& _Lobj, size_t _R = 0)
: ctype_base(_R) {_Init(_Lobj); }
static size_t __cdecl _Getcat()
{return (_LC_CTYPE); }
_PROTECTED:
virtual ~ctype()
{if (_Ctype._Delfl)
free((void *)_Ctype._Table); }
protected:
void _Init(const _Locinfo& _Lobj)
{_Ctype = _Lobj._Getctype(); }
virtual bool do_is(mask _M, _E _C) const
{return ((_Ctype._Table[narrow(_C)] & _M) != 0); }
virtual const _E *do_is(const _E *_F, const _E *_L,
mask *_V) const
{for (; _F != _L; ++_F, ++_V)
*_V = _Ctype._Table[narrow(*_F)];
return (_F); }
virtual const _E *do_scan_is(mask _M, const _E *_F,
const _E *_L) const
{for (; _F != _L && !is(_M, *_F); ++_F)
;
return (_F); }
virtual const _E *do_scan_not(mask _M, const _E *_F,
const _E *_L) const
{for (; _F != _L && is(_M, *_F); ++_F)
;
return (_F); }
virtual _E do_tolower(_E _C) const
{return ((_E)widen((char)_Tolower(narrow(_C), &_Ctype))); }
virtual const _E *do_tolower(_E *_F, const _E *_L) const
{for (; _F != _L; ++_F)
*_F = (_E)_Tolower(*_F, &_Ctype);
return ((const _E *)_F); }
virtual _E do_toupper(_E _C) const
{return ((_E)widen((char)_Toupper(narrow(_C), &_Ctype))); }
virtual const _E *do_toupper(_E *_F, const _E *_L) const
{for (; _F != _L; ++_F)
*_F = (_E)_Toupper(*_F, &_Ctype);
return ((const _E *)_F); }
virtual _E do_widen(char _X) const
{return (_WIDEN(_E, _X)); }
virtual const char *do_widen(const char *_F, const char *_L,
_E *_V) const
{for (; _F != _L; ++_F, ++_V)
*_V = _WIDEN(_E, *_F);
return (_F); }
virtual char do_narrow(_E _C, char) const
{return ((char)_NARROW(_E, _C)); }
virtual const _E *do_narrow(const _E *_F, const _E *_L,
char, char *_V) const
{for (; _F != _L; ++_F, ++_V)
*_V = (char)_NARROW(_E, *_F);
return (_F); }
private:
_Locinfo::_Ctypevec _Ctype;
};
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 30th, 2001, 04:31 PM
#2
Fanatic Member
Not related to the post, but what are Bork Expression Templates?
Alcohol & calculus don't mix.
Never drink & derive.
-
Dec 31st, 2001, 06:33 AM
#3
Monday Morning Lunatic
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 31st, 2001, 07:53 AM
#4
Thread Starter
transcendental analytic
Expression templates are used to optimize the use of registers, I'm also using them in a new paradigm Bork, which opens a new dimension in C++, the Bork environment allows infinitely "polymorphic" typing at designtime, unlike the strong typed environment in C++ it will provide the generic flexibility when implementing, combining and extending objects as well as algoritms,
An example of what you can do currently with some types:
MyWindow+=Rect(1,2,3,4)+Size(10)*Rect(1,2,3,4)+Width(30)-Square(2)+Convert<my2dprojector>(3dvector(x,y,z))+Green+RGB(3,24,123)+Elephant;
would move the window 27,13,47,43+the projection of the 3d point, and add the color 3,255,123 to current window color, but the elephant would have no effect on the window, on the other hand it won't slow down the performance. In fact doing this with regular types would take both lots of runtime performance as well as design time struggling. With Bork this is all trivial
Last edited by kedaman; Dec 31st, 2001 at 07:56 AM.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 31st, 2001, 05:19 PM
#5
Fanatic Member
Uhh...cool
Alcohol & calculus don't mix.
Never drink & derive.
-
Dec 31st, 2001, 05:37 PM
#6
kedaman, you are either brilliant, or insane =).
Z.
-
Dec 31st, 2001, 07:05 PM
#7
Thread Starter
transcendental analytic
parksie told me I was mad yesterday I guess I only know what madness means
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 31st, 2001, 08:42 PM
#8
Hyperactive Member
Hi Kedaman, are you doing all these work on VC?
I thought (after reading your previous posts) that VC is unsuitable for writing templates as it doesn't fully support templates as well as hmm... Borland C++ Builder.
-
Dec 31st, 2001, 09:00 PM
#9
Thread Starter
transcendental analytic
Yep, I'm struggling as shown with VC Borland has better conformance but the optimations really suck (at least according to parksie) so I won't bother switching.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 1st, 2002, 10:31 AM
#10
Monday Morning Lunatic
VC++ 7 (aka .NET) is a lot better with templates, and gives you more help on where you've gone wrong.
It claims to do partial specialisation now - however, the most conformant is still GCC...pity it doesn't install on Windows.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 6th, 2002, 10:56 AM
#11
What is _Locinfo? What is _CTypeevec? I guess you're rewriting ctype.h to a C++ version that takes full care of locales and such automatically, right? What is mask? What is _PROTECTED? Is it a macro that becomes either public or protected, depending on compiler?
Really Keda, you can't expect us to know all your weird templates. Have you written a single real, pure class in the last three month?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 6th, 2002, 11:20 AM
#12
Monday Morning Lunatic
Er...that code he posted is from the standard headers 
Which, incidentally, do all the locale stuff
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 6th, 2002, 03:38 PM
#13
Oh...
So, the standard headers don't compile?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 6th, 2002, 03:45 PM
#14
Monday Morning Lunatic
Normally they would. However, if it has problems compiling the type when used with whatever you decide to parameterise it with, then it shows up inside the template.
Also, you can bugger up the internals by putting other totally unrelated code that's broken it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 6th, 2002, 03:46 PM
#15
Thread Starter
transcendental analytic
Internal Compiler Error, I don't know how the compiler works but certainly it doesn't (in this case).
I'm about to write my own language, as even with the right macro's that hide the template specification syntax, it looks messy.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 6th, 2002, 03:57 PM
#16
-
Jan 6th, 2002, 04:37 PM
#17
Thread Starter
transcendental analytic
Nope, it will compile to C++ code
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 6th, 2002, 07:15 PM
#18
Frenzied Member
Originally posted by parksie
x now has the value 28 (2 x 14)
*Ahem* I think you mean 32 (2 x 16)
Harry.
"From one thing, know ten thousand things."
-
Jan 7th, 2002, 11:53 AM
#19
Monday Morning Lunatic
Oh buggery...it's 14 pounds to the stone, isn't it?
Oh well this is probably why nobody uses imperial anymore
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|