|
by: Jason Heyes |
last post by:
What harmful effects can using std::vector have on the performance of my
program? How do I protect my program from these effects? Thanks.
|
by: Fred Zwarts |
last post by:
There are a few things I do not understand about the vector class
in de standard C++ library. The description of the resize member
function says:
void
resize(size_type sz);Alters the size of self. If the new size (sz) is greater than the current size, then sz-size() instances of the default value of type T are inserted at the end of the vector. If the new size is smaller than the current capacity, then the vector is truncated by erasing...
|
by: Mark P |
last post by:
Say I have objects of class C which are fairly large. Then consider:
vector<C> vc;
vc.push_back(C());
Naively this would seem to construct a temporary object C(), copy it
into the space owned by the vector, and then delete the temporary object.
I realize this is implementation dependent, but will most modern
compilers optimize away the creation of the temporary object, or is
|
by: bluekite2000 |
last post by:
and why doesnt the standard vector have such conversion available?
|
by: Jay |
last post by:
I'd like to experiment a little bit with vector graphics in python.
When I say 'vector graphics' I don't mean regular old svg-style. I
mean vector game style as in simulation of vector beam drawn graphics.
If you still don't know what I'm talking about, see Grid Wars 2
(http://gridwars.marune.de/) or Battlezone
(http://en.wikipedia.org/wiki/Battlezone). I'm guessing I'd just be
drawing shapes with particle effects?
Anyway, I need help...
|
|
by: Jess |
last post by:
Hello,
I tried to clear a vector "v" using "v.clear()". If "v" contains
those objects that are non-built-in (e.g. string), then "clear()" can
indeed remove all contents. However, if "v" contains built-in types
(e.g. int), then "clear()" doesn't remove anything at all. Why does
"clear()" have this behaviour?
Also, when I copy one vector "v1" from another vector "v2", with "v1"
longer than "v2" (e.g. "v1" has 2 elements and "v2" has...
|
by: gregerly |
last post by:
I'm a total flash / actionscript newbie. I have a question about how to create a flash background as seen here:
Adobe MAX
I don't expect a detailed explanation. I'm just looking for some info on how they create the particle effects and moving backgrounds. It looks really cool but I wouldn't know where to start to create something like that.
Thanks,
Greg
|
by: smp |
last post by:
Does anyone know why making a vector of pointers is so much less efficient
than a vector of objects? For a simple example:
int num = 20;
vector<int*v_int_ptr;
v_int_ptr.reserve(num);
for(int i = 0; i < num; i++)
{
int* my_int_ptr = new int;
|
by: stephen b |
last post by:
Hi all, personally I'd love to be able to do something like this:
vector<intv;
v.assign(1, 2, 5, 9, 8, 7) etc
without having to manually add elements by doing v = 1, v = 2 ..
etc.
it would make for much more readable code that is faster to write in
some situations. I've not seen this feature documented anywhere
|
by: Daniel Pitts |
last post by:
I have std::vector<Base *bases;
I'd like to do something like:
std::for_each(bases.begin(), bases.end(), operator delete);
Is it possible without writing an adapter? Is there a better way? Is
there an existing adapter?
Thanks,
Daniel.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|