Thank you so much for your reply.
Unfortunately there is a problem with using pointers.
This little program illustrates this:
#include <QtCore/QCoreApplication>
#include <emmintrin.h>
class myClass {
public:
myClass();
~myClass();
__m128i O;
};
myClass::myClass()
{
//sets the O to 0 bits.
O = _mm_set_epi32 (0x00000000,0x00000000,0x00000000,0x00000000);
}
myClass::~myClass()
{
}
int main(int argc, char *argv[])
{
QList<myClass *> list;
list.append(new myClass());
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <emmintrin.h>
class myClass {
public:
myClass();
~myClass();
__m128i O;
};
myClass::myClass()
{
//sets the O to 0 bits.
O = _mm_set_epi32 (0x00000000,0x00000000,0x00000000,0x00000000);
}
myClass::~myClass()
{
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QList<myClass *> list;
list.append(new myClass());
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Because I am using SSE2 instructions, the program crashes... However, if instead use: list[20]; there is no problem. But using *list[20]; the program crashes in the same manner.
If I replace: list.append(new myClass()); with list.append(&myClass()); it does not crash, but I don't think this is any good?
My question? How would I rewrite the program to allow for QList<myClass> list; instead of QList<myClass *> list;
Thank you!
Havard
Bookmarks