Downcast with smart pointers?


, I'm having a design issue that I can't solve. I'm getting from a network a stream of data, which is a http message (my program is neither a client or server, it just catches messages over the network) For ...
Posted On: Monday 26th of November 2012 12:06:51 AM Total Views:  78
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




up/downcast with shared_ptr?

guess you have the following: class AA; class A { shared_ptr m_a; }; class BB: public AA; class B { shared_ptr m_a; }; void g(B* pB); void f(A* pA) {
VIEWS ON THIS POST

127

Posted on:

Saturday 3rd November 2012
View Replies!

Problem with static downcast of base type to derived type

I have a program which crashes when: 1 - I use static_cast to turn a base type pointer into a pointer to a derived type 2 - I use this new pointer to call a function in an object of ...
VIEWS ON THIS POST

167

Posted on:

Sunday 11th November 2012
View Replies!

Re: Sorting two arrays with one call to sort()?

{ Edits: Yahoo spam-like links removed from signature portion. Note 1: the quoted article by "xxx@gmail.com" doesn't appear to have been posted in clc++m, although the inner quoted article by John was. Note 2: Tom arken has the same e-mail ...
VIEWS ON THIS POST

177

Posted on:

Sunday 25th November 2012
View Replies!

Help with an Assignment(newb help)

hello to all. i am in a Introductory C++ class and I have been having some issue with an assignment that i was given. Here is a brief setup for it. Write a program to print out a loan repayment ...
VIEWS ON THIS POST

187

Posted on:

Sunday 25th November 2012
View Replies!

Re: problem with C++ sort algorithm

wrote in message news:1155522546.904881.258730@75g2000cwc.googlegroups.com... > so i realize that i'm asking you to look into your crystal balls, > but any other suggestions are welcome and greatly appreciated. You believe that your vector contains no zero pointers. In ...
VIEWS ON THIS POST

211

Posted on:

Sunday 25th November 2012
View Replies!

Problem with solaris compiler

static char* nullStr = "null"; This line in the solaris mode64 ( cc -m64 flag, gives out the following warning message ) "virvpirw.cc", line 371: Warning: String literal converted to char* in initialization. 1 Warning(s) detected. Now our builds are ...
VIEWS ON THIS POST

146

Posted on:

Sunday 25th November 2012
View Replies!

Program launches within Visual Stdui 2005, fails otherwise.

Hi all. I recently made a program to retreive the process ID of a process. It is written in C/C++ and works fine when I launch it from Visual Studio 2005. However, when i launch it from a command prompt ...
VIEWS ON THIS POST

177

Posted on:

Sunday 25th November 2012
View Replies!

How to build a loadable tcl dll with visual studio (microsoft C compiler)?[crosspost in comp.lang.tcl and comp.lang.c++]

Example one from http://www.tcl.tk/man/tcl8.4/TclCmd/load.htm: #include #include static int fooCmd(ClientData clientData, Tcl_Interp *interp, int objc, char * CONST objv[]) { printf("called with %d arguments\n", objc); return TCL_OK; } int Foo_Init(Tcl_Interp *interp) { if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { ...
VIEWS ON THIS POST

177

Posted on:

Sunday 25th November 2012
View Replies!

Problem with Linked List

I made a linked list that can add an item, go to the first item, and get the current, next, and previous item in the list. When I compile it, there are no errors, but it overloads. Here is the ...
VIEWS ON THIS POST

128

Posted on:

Sunday 25th November 2012
View Replies!

anyone with VC++ 2005?

Jim Michaels wrote: > #define MAXIMUM_WAIT_OBJECTS 64     // Maximum number of wait objects > #define MAXIMUM_PROCESSORS 32 This question will get the best results on a newsgroup with 'windows' and 'kernel' in its name. It's not a C++ ...
VIEWS ON THIS POST

173

Posted on:

Sunday 25th November 2012
View Replies!

Strange error with iterators

I've wrote this function which should add a comma for every 3 digits in a number (so that it looks something like 5,000). This is my function: std::string formatNumber(int number) { // Convert the int to a string. std::string ...
VIEWS ON THIS POST

523

Posted on:

Sunday 25th November 2012
View Replies!

Problems with template specializations.

Please check the following snippet.. template class CheckUni { public: void This() { std::cout << "Basic type\n"; } }; template class CheckUni< CheckUni > { public: void This() { std::cout << "CheckUni type\n"; } }; CheckUni ...
VIEWS ON THIS POST

224

Posted on:

Sunday 25th November 2012
View Replies!

regarding sizeof operator for class with no data variables

consider this code snippet #include using namespace std; class A { void func() { } void func1() { } void func2() { } void func3() { } }; int main() { cout<
VIEWS ON THIS POST

202

Posted on:

Sunday 25th November 2012
View Replies!

regarding sizeof operator for class with no data variables

consider this code snippet #include using namespace std; class { void func() { };...
VIEWS ON THIS POST

188

Posted on:

Sunday 25th November 2012
View Replies!

ICC with -cxxlib-gcc --- results in ld: /usr/lib/crtbeginS.o: No such file error

Hi , I am compiling my c++ code with ICC 8.0 compiler with -cxxlib-gcc option...But this results in following error.. /usr/lib/crtbeginS.o : No such file: No such file or directory Though I am including the Path for crtbeginS.o . Code ...
VIEWS ON THIS POST

767

Posted on:

Sunday 25th November 2012
View Replies!

Re-usable singleton class that can construct pointers to objects with non-trivial constructors

As the topic says, I wanted to make a re-usable singleton class that could create pointers to objects with non-trivial constructors. I came up with this: #ifndef SINGLETON_HPP #define SINGLETON_HPP template struct DefaultCreatorFunctor { T * operator()() const { ...
VIEWS ON THIS POST

232

Posted on:

Sunday 25th November 2012
View Replies!

Parsing c++ with typename-tagging

...
VIEWS ON THIS POST

62

Posted on:

Monday 26th November 2012
View Replies!

help with file I/O

I'm new to C++, and I want to open a file, go through it line by line and pull out specific things on each line. I've written a test bit of code to try to do this. For some ...
VIEWS ON THIS POST

93

Posted on:

Monday 26th November 2012
View Replies!

c struct with pointers assignment

, I have a struct with pointers. I am trying to assign and instance of the struct but keep getting a seg fault. I am new to c, so I am uncertain of how to handle this.
VIEWS ON THIS POST

76

Posted on:

Monday 26th November 2012
View Replies!

Handling daylight savings with standard time functions?

Is there any way to make time-of-day adjustments for daylight savings using only standard time functions We have a program that executes daily at a fixed time of day. After daylight savings happens, the time-of-day alignment is lost. For ...
VIEWS ON THIS POST

105

Posted on:

Monday 26th November 2012
View Replies!