The offending code:
template<typename T>
class SharedObject {
public:
typedef boost::intrusive_ptr<T> Pointer;
typedef boost::intrusive_ptr<T const> ConstPointer;
inline Pointer GetPointer() {
return Pointer(this); //Ambiguous call here
}
inline ConstPointer GetPointer() const {
return ConstPointer(this);
}
...
...
I am looking for efficent algorithm for checking if one point is nearby another in 3D.
sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) < radius
This doesn't seem to be too fast and actually I don't need such a big accuracy. How else could I do this?
...
Hi. Probably asking this shows that I don't have the convenient grasp on OOP, but...
How can I call a derived function from a base class? I mean, being able to replace one function from the base to the derived class.
Ex.
class a
{
public:
void f1();
void f2();
};
void a::f1()
{
this->f2();
}
/* here goes the a::f2() definit...
Hello!
Do you know how can I log the exception ?
right now the message in the catch statement is printed, but i cannot understood why ins´t Manage.Gere() called sussefully .
try{
Manager.Gere(&par,&Acc, coman, comando, RunComando, log, &parti, comandosS, RunComandosSuper,true);
}
catch (...)
{
log("ERROR ENTER GERE*****");
}
...
Is there a way in Visual Studio, either through it's native features or a plugin, to show an integer/long/char variable in the debugger window as a bit array? For example, rather than seeing 5 or 0x5 I'd like to see 101. As a bonus feature I'd like to see them left-padded with the correct amount of zeroes, so that the total width of the...
Trying to write a simple VCL program for educating purposes (dynamicly created forms, controls etc). Have such a sample code:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TForm* formQuiz = new TForm(this);
formQuiz->BorderIcons = TBorderIcons() << biSystemMenu >> biMinimize >> biMaximize;
formQuiz->Position = TPos...
Hello. I make a simle window with wxwidgets. How can i change the border?
Also how can i call the destroy fuction(OnClose) with the right arrow button press?
#include <wx/wx.h>
class _Frame: public wxFrame
{
public:
_Frame(wxFrame *frame, const wxString& title);
private:
void OnClose(wxCloseEvent& event);
D...
Hi
What is the best way to capture streamed MJPEG from a network IP camera?
I'd like to get frames and process them, using c++ (or python extended with c++).
Is OpenCV my best option?
Thanks
Simon
...
I've been using DJGPP for the first time recently and can't seem to enable mouse support. What's the best way?
Thanks for any help.
...
I'm using the NTL library to implement ElGamal encryption/decryption algorithm.
I've got it to the point that it's working but the algorithm wants the message to be converted to integers so it can be encrypted.
So if i input a number like 1234 everything works ok but how would i go to be able to convert a C++ string (std::string) to a ZZ...
Hi,
I have just found out that the following is not valid.
//Header File
class test
{
const static char array[] = { '1', '2', '3' };
};
Where is the best place to initialize this?
Thanks in advance;
...
Hi. I'm using visual studio 2003 and I'm getting the following linking error in my project:
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
msvcrtd.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
C:\Documents and Settings\mz07\Desktop\project\H...
I know there is a question similar to mine: http://stackoverflow.com/questions/1010937/extract-wav-file-from-video-file
I am new to C++ and understand about COM library + directX is needed for video and audio. I been looking for tutorial and samples code but little success.
My question is how do I code the application to take video fi...
I've been developing a library of mostly template functions and managed to keep things organized (to some extent) in the following manner:
// MyLib.h
class MyLib
{
template<class T>
static void Func1()
{
}
template<class T>
static void Func2()
{
}
};
And obviously calls would be made like this:
MyLib::Func1();
As y...
How to I access the data returned on a web page using the TCppWebBrowser component in Borland Builder 6.0?
I have succeeded in posting data using the sample at:
http://edn.embarcadero.com/article/27519
...
Hello
Can you give me advice for a modern book(s) for Effective C++ Programming
By modern I mean that I want it to include new features from Boost C++ Library (casts, smart pointers, etc.)
I have these books:
Effective C++: 55 Specific Ways to
Improve Your Programs and Designs
More Effective C++: 35 New Ways to
Improve Your Programs...
Segmentation fault when calling the Update_Multiplier and gdb debugger shows these:
Program received signal SIGSEGV, Segmentation fault.
0x080b74e8 in Update_Multiplier() ()
double upperbound = 116325;
double objective = 1.1707e+07;
int main()
{
Update_Multiplier();
}
void Update_Multiplier()
{
cout << "function 0" << end...
Consider the following class.
class mapping_items
{
public:
mapping_items(){}
void add(const mapping_item* item) {
items_.push_back( item );
}
size_t count() const{
return items_.size();
}
const mapping_item& find(const std::string& pattern){
const mapping_item* item = // iterate vecto...
I'm currently working on a wireless networking application in C++ and it's coming to a point where I'm going to want to multi-thread pieces of software under one process, rather than have them all in separate processes. Theoretically, I understand multi-threading, but I've yet to dive in practically.
What should every programmer know...
Is it possible to do something along the lines of:
type t = int;//this would be a function which identifies what type the next argument is
if( t == int )
printf( "%d", va_arg( theva_list, t ) );
in a relatively trivial way? The only object I know which can hold a type is type_info and I can't work out how to use it in this way.
T...