Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » what's wrong
what's wrong [message #8187] |
Thu, 15 February 2007 09:56  |
Ulti
Messages: 108 Registered: September 2006
|
Experienced Member |
|
|
void App::ExcelIt()
{
Vector<byte> s;
int32 val;
s.Add(0x0);s.Add(0x0);
s.Add(0x0);s.Add(0x01);
EndianRW::Endian::Read(s,val,0,false);
PromptOK(AsString(val));
}
namespace EndianRW
{
using namespace Upp;
struct Endian
{
template<typename Type>
static void Read(const Vector<byte>&from,Type& retVal,int32 pos=0,int32 bytes=0,bool LE=true)
{
retVal=Type(0);
if(0==bytes) bytes=sizeof(Type);
for(int32 i=0;i<bytes;++i)
{
retVal|=(LE?(((Type)((byte)from[pos+i]))<<8*i) ((Type)((byte)from[pos+i]))<<8*(bytes-i-1)));
}
}
};
}
MSC7.1 windowsXP
Error messages:
d:\Ulti\MyApps\OPath\UEndian.h(15) : error C2666: 'Upp::Vector<T>::operator`[]'' : 2 overloads have similar conversions
with
[
T=Upp::byte
]
D:\Ulti\upp\uppsrc\Core\Vcont.h(32): could be 'const Upp::byte &Upp::Vector<T>::operator [](int) const'
with
[
T=Upp::byte
]
or 'built-in C++ operator[(Upp::byte , Upp::int32)'
while trying to match the argument list '(const Upp::Vector<T>, Upp::int32)'
with
[
T=Upp::byte
]
D:\Ulti\MyApps\OPath\main.cpp(128) : see reference to function template instantiation 'void EndianRW::Endian::Read<Upp::int32>(const
Upp::Vector<T> &,Type &,Upp::int32,Upp::int32,bool)' being compiled
with
[
T=Upp::byte,
Type=Upp::int32
]
d:\Ulti\MyApps\OPath\UEndian.h(15) : error C2666: 'Upp::Vector<T>::operator`[]'' : 2 overloads have similar conversions
with
[
T=Upp::byte
]
D:\Ulti\upp\uppsrc\Core\Vcont.h(32): could be 'const Upp::byte &Upp::Vector<T>::operator [](int) const'
with
[
T=Upp::byte
]
or 'built-in C++ operator[(Upp::byte , Upp::int32)'
while trying to match the argument list '(const Upp::Vector<T>, Upp::int32)'
with
[
T=Upp::byte
]
OPath: 1 file(s) built in (0:02.27), 2274 msecs / file, duration = 2284 msecs
There were errors. (0:02.70)
compiled with MINGW32 passed
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:52:33 CEST 2025
Total time taken to generate the page: 0.00709 seconds
|