It may be a bit confusing, but...
Let's say I have a vector type member in a class, something like vector<Operator*> ( I have methods on my class to return Operators from this container).
Now lets say that I have a method on my class that receives an Operator object op and inserts it on the vector. What I want to know is: will I have an...
I have a BorderContainer with several objects inside of it. I want it to fit snugly around its own contents, but it doesn't. It seems the default size of a BorderContainer is 112x112. That is so wierd considering no other containers have that default size. Is there a way to set the width and heigh properties to "auto" or something like t...
I have a piece of performance critical code written with pointers and dynamic memory.
I would like to rewrite it with STL containers, but I'm a bit concerned with performance. Is there a way to increase the size of a container without initializing the data?
For example, instead of doing
ptr = new BYTE[x];
I want to do something like...
Hi!
I'm looking for a variant of the STL (it's okay if it doesn't have all the functionality) that's optimized for short compile times -- I get bothered by long compile times that delay my compile-debug-edit cycle.
I'm mainly interested in the containers of the STL: vector/map, and not so much the algorithms.
Thanks!
...
I'm looking for some STL, boost, or similar container to use the same way indexes are used in databases to search for record using a query like this:
select * from table1 where field1 starting with 'X';
or
select * from table1 where field1 like 'X%';
I thought about using std::map, but I cannot because I need to search for fields t...
It says here that
The unbounded array is similar to a
std::vector in that in can grow in
size beyond any fixed bound. However
unbounded_array is aimed at optimal
performance. Therefore unbounded_array
does not model a Sequence like
std::vector does.
What does this mean?
...
Hello, I am porting a library from C++ to C#. The old library uses vectors from C++ and in the C# I am using generic Dictionaries because they're actually a good data structure for what I'm doing (each element has an ID, then I just use using TypeDictionary = Dictionary<String, Type>;). Now, in the C# code I use a loop like this one
Typ...
Hello,
I have a JLabel in a Container.
The defaut size of the font is very small.
I would like that the text of the JLabel to take the maximum size.
How can I do that ?
Thanks :)
...
I tried the solutions that are posted in this related SO question and for the most part the code snippets are working, but there are some cases that are still getting garbled by Blogger when it publishes the blog.
In particular, declaring generic containers seems to be most troublesome. Please see the code examples on my blog: http://ml...
I've written a (array) container class template (lets call it smart array) for using it in the BREW platform (which doesn't allow many C++ constructs like STD library, exceptions, etc. It has a very minimal C++ runtime support); while writing this my friend said that something like this already exists in Boost called MultiArray, I tried ...
I have a Path that must resize to its StackPanel container.
<StackPanel x:Name="TrackSurface">
<Path Fill="AliceBlue"
Stroke="Black" StrokeThickness="1"
Data="{StaticResource TranslateZ}">
</Path>
</StackPanel>
I think about using a transformation bound to the container but don't know how to it actually. Ca...
Hi all,
I have a method
void foo(list<shared_ptr<Base>>& myList);
Which I'm trying to call with a two different types of lists, one of DerivedClass1 and one of DerivedClass2
list<shared_ptr<DerivedClass1>> myList1;
foo(myList1);
list<shared_ptr<DerivedClass2>> myList2;
foo(myList2);
However this obviously generates a compiler ...
Hi,
I have this destructor that create error at runtime "vector iterator not dereferencable".
The gridMatrix is a std::vector<std::vector<std::vector<AtomsCell< Atom<T> * > * > * > * >
I added the typename and also the typedef but I still have the error.
I will move for this idea of vect of vect* of vect* to use boost::multi_array I ...
Title pretty much covers it. If I've added say 3 objects to a list and the list goes out of scope and dies, will it call delete on each entry before going out of scope? Pretty sure yes, but getting tired and need a sanity check.
...
I find myself often with a situation where I need to perform an operation on a set of properties. The operation can be anything from checking if a particular property matches anything in the set to a single iteration of actions. Sometimes the set is dynamically generated when the function is called, some built with a simple LINQ statemen...
Hey there, I'm writing a template container class and for the past few hours have been trying to allocate new memory for extra data that comes into the container (...hit a brick wall..:| )
template <typename T>
void Container<T>::insert(T item, int index){
if ( index < 0){
cout<<"Invalid location to insert " << index << endl...
Possible Duplicate:
Is there a production ready lock-free queue or hash implementation in C++
I'm looking for implementations of lock-free containers:
Queue
Stack
Hash Map
etc...
How about blocking containers:
Blocking Queue
Blocking Stack
Are there any good libraries out there? I would like to refrain from writing the...
Hi there,
I'm writing an own container class and have run into a problem I can't get my head around. Here's the bare-bone sample that shows the problem.
It consists of a container class and two test classes: one test class using a std:vector which compiles nicely and the second test class which tries to use my own container class in ex...
After another question about iterators I'm having some doubts about custom containers. In my container, iterator is a subclass of const_iterator, so that I get conversion from non-const to const "for free". But is this allowed or are there any drawbacks or non-working scenarios for such a setup?
...
I have a Delphi (BDS 2006) application with TOleContainer control. It has an OLE object inside, MS Equation formula (name 'Equation.3') from MS Office 2003.
How can I extract the vector metafile from the formula image to insert it into web-page or some other document without OLE support?
TOleContainer has only 'Equation.3' objects ins...