Hello, I am a new beginner with boost. And here is my test code,
using namespace boost::lambda;
std::vector<std::string> strings;
strings.push_back("Boost");
strings.push_back("C++");
strings.push_back("Libraries");
std::vector<int> sizes;
std::for_each(
strings.begin(),
strings.end(),
bind(
&std::vector<...
Hi!
what's the best way to perform bitwise operations on vector<bool>?
as i understand, vector<bool> is a specialisation that uses one bit per boolean. I chose vector<bool> for memory saving reasons. I know that there are some problems with vector<bool> but for my needs it's apropriate.
now - what's the most performant way of aplying ...
Im trying to optimize my exercise application in VS2010.
Basically I have several sqrt, pow and memset in the core loop.
More specifically, this is what I do:
// in a cpp file ...
#include <cmath>
#pragma intrinsic(sqrt, pow, memset)
void Simulator::calculate()
{
for( int i=0; i<NUM; i++ )
{
...
float len = std::sqrt(lenSq...
I'm working on a C++ project where modules are meant to be combined in a small group to serve a specific purpose (in some sort of processing pipeline).
Sometimes it's hard to know the impact of any change, because we intuitively don't even know all the places where one of our module is being used.
I know I can do Search in Files to fin...
What is the easiest way to take something out of an vector and changes its values? This isn't working the way I expected.
for(int i = 0; i < list.size(); i++) {
someType s = list.at(i);
s.x = 10;
s.y = 20;
s.z = 30;
}
However, when I go to print out the x,y,z of that someType s, it doesn't give me what I expect. Sorry I am mixing up ...
I have a native (C++) process and a managed (C#) process on the same system. I want to enable communications between the two, similar to how one could use RPC between two native processes. I know I could use WCF using Microsoft's WWSAPI in the native process., but I was wondering what other options do I have? Or is WCF the best/only s...
include<iostream>
class Hanoi {
private:
int n;// no. of disks
public:
Hanoi(int);
solve(char, char, char int);
};
void Hanoi :: Hanoi(int a) {
cout << "Enter number of disks : " << endl;
cin >> a;
n = a;
}
void Hanoi :: tower(char from, char use, char to) {
if (n > 0) {
tower(n-1, from, use, to);
cout << "Move disk " << ...
Why do some folds in vim are saved some not while some are being saved? I have the following in my .vimrc:
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
Example:
I make these 2 folds in a file:
+-- 2 lines: if(!bRet)---------------------------...
return bRet;
}
+----------- 5 lines: else---------...
hi,
How to set tooltip at runtime in MFC Treeview ?
I am creating treeview like this :
m_pTreeview->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP |
TVS_SINGLEEXPAND,CRect(38, 82, 220 ,250), this, IDC_NDS_TREEVIEW);
Any help is appreciated..
...
I have the following class:
class PluginLoader
{
public:
PluginLoader(Logger&, PluginFactory&, ConflictResolver&);
//Functions.
private:
//Members and functions
};
Logger, PluginFactory and ConflictResolver classes are all interface classes which will be implemented in the application. I create the single PluginLoader obje...
I'm new to C++. Here is the code:
template <class T> typename lw_slist {
// .... some code
private:
typedef struct _slist_cell {
_slist_cell *next;
T data;
} slist_cell;
lw_slist::slist_cell *root;
};
Give this compilation error:
error C4430: missing type specifier - int ...
bool fp[81];
From my understanding fp should use ceil(81/8) bytes because it is in succession.
Am I correct?
How can I prove this?
...
I am compiling the code below when the following erro comes up. I am unable to find the reason.
typedef union {
struct {
const int j;
} tag;
} X;
int main(){
return 0;
}
error: member `<`anonymous union>::`<`anonymous struct> `<`anonymous union>::tag with copy assignment operator not allowed in union
This code c...
Assertion is used to check whether a condition is met(precondition, postcondition, invariants) and help programmers find holes during debugging phase.
For example,
void f(int *p)
{
assert(p);
p->do();
}
My question is do we need to assume the condition could not be met in release mode and handle the case accordingly?
void f(int ...
Possible Duplicate:
loop with if consition
int i, j, c = 0;
int num = ring.points_.size();
for (i = 0, j = num-1; i < num; j = i++) {
if ((((ring.points_[i].y_ <= pt.y_) && (pt.y_ < ring.points_[j].y_)) ||
((ring.points_[j].y_ <= pt.y_) && (pt.y_ < ring.points_[i].y_))) &&
(pt.x_ < (...
Hi i need to call a external EXE (same running exe )from a C++ method i used
system("filepath");
but in the current file closed and new exe doesn't create the new instance
How can i call a exe with absolute path ?
...
I need to validate a user input using getch() only to accept numeric input
`int input_put=getch();`
if(input >=0 && < 9){
}else{
}
...
what is the difference between typecasting and typeconversion in c++ or java ?
...
Hello! i want to parse a xml like that. My output need to be a code in c or c++ who make the transformation of each letter in phoneme. I introduce a word at input and my generated code need tu pe transformed based on the rules from xml. Any sugestion for begening pls...
<?xml version="1.0" encoding="UTF-8"?>
<rules>
<define_groups...
Hi all..
I need a C/C++ source code editor (for Linux) which has Source Insight's features, such as:
Context window : when our cursor is above variable/class/function, the context window will display the declaration of that variable/class or the implementation body of that function
Ctrl+Click at any variable/class/function, it will ju...