Hi,
I was wondering how many of you here use the Boost libraries with your Qt applications?
Regards,
Steve
Yes, I use Boost libraries for Qt applications.
Yes, I do, but only for non-Qt applications.
No, I don't use them at all.
Hi,
I was wondering how many of you here use the Boost libraries with your Qt applications?
Regards,
Steve
I have added a poll, so that everybody can answer this question easily.
steg90 (10th May 2007)
What is Boost libraries?
is this a way to become more source code line? I know only QT libs, curl, tidy, libxslt, libxml2, libexiv2 , Sablot XSLT, all lib wo can build on all OS...
my last discovery libs is http://poppler.freedesktop.org/ to transform pdf to image... but is not possibel to build if automake or autoconf is not the last version..
libraries wo is not possibel to build quick , not give sense to me. this is like to write a cin.getline from string and transform to QString
Hi,
Take a look at http://www.boost.org
Regards,
Steve
I have used Boost, but it's cumbersome to use. It is a very "academic" library that is wholly unsuitable if you are not a C++ expert. It relishes in using all of the advanced features of C++, even for the simplest of problems. It is primarily based not on Object Oriented Programming, but Generic Programming. If you don't know what a functor is, stay away!
Most things that Boost gives you are already available in Qt.
"The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry
Actually, Boost is quite interdependent as well. It's nearly impossible to take just one class (or set of related classes) out of Boost and use it by itself. And while some people are lobbying for parts of Boost to be included in a future C++ standard library, that does NOT mean Boost should be treated as a C++ standard.
I have noticed a lot of the financial trading software houses in the uk use Boost?!
There's a lot of US financial trading companies in New York using Qt :-)
Especially if their software was written by ICS
Pity I'm in the UK! I do know certain financial houses do use Boost here in the UK. I have 'played' with it in the past and used mainly the smart pointers as I often forget to delete pointers and using these, it does it for you
Smart pointers delete objects? I think we're having a different concept of smart pointers... Mine is that it sets the pointer to 0 once the object pointed is deleted. The concept you described I'd call a hijacking pointer and I don't want my pointers hijacked Anyway: QPointer.
Hi,
Not heard of 'hijacking' pointer
I'll take a look at QPointer, thanks!
Regards,
Steve
It's hijacking, because when it's destroyed, it destroys the pointed object as well (that's what you said). This means that if it doesn't have ownership of the object, it'll hijack it from the real owner. And it's probably implemented more or less like so:
Qt Code:
template <typename T> class HijackingPointer { public: HijackingPointer(T *ptr=0), m_ptr(ptr){} void setPointer(T* ptr){ m_ptr = ptr; } ~HijackingPointer(){ delete m_ptr; } // + operator T*, operator * and operator -> private: T* m_ptr; };To copy to clipboard, switch view to plain text mode
I don't think I have to link to a bloated library just for this small snippet.
So Boost pointers won't do that for you:
Right?. I have 'played' with it in the past and used mainly the smart pointers as I often forget to delete pointers and using these, it does it for you.
So is there a pointer in the family that deletes objects pointed to when it's deleted but doesn't hijack the object (for me this is contradictory, but maybe I just can't imagine the situation)?
Boost has three kinds of smart pointers:
- shared pointers, which share the ownership amongs them,
- scoped pointers, which take the ownership for themselves,
- weak pointers, which don't take the ownership, but know when the object was destroyed.
All these three kinds of smart pointers are well behaved and the term "hijacking" isn't appropriate. It's just as if you said that QCoreApplication::postEvent() "hijacks" pointers, because it takes their ownership --- it doesn't, it's just a part of its contract.
If you want to call something "pointer hijacking", take a look what std::auto_ptrs do on copy --- they're like hungry hienas, which steal a dead antilope from each other.
So "weak pointer" is an equivalent of QPointer, "scoped pointer" does to pointers more or less what QMutexLocker does to mutexes and shared pointer is a combination of the two that does reference counting. Correct? Of course all these might fail if you use any regular pointers with the same object.
Bookmarks