Search Results

Search found 14 results on 1 pages for 'uray'.

Page 1/1 | 1 

  • C++ Win32 Unhandled Exception Handler

    - by uray
    currently I used SetUnhandledExceptionFilter() to provide callback to get information when an unhandled exception was occurred, that callback will provides me with EXCEPTION_RECORD which provides ExceptionAddress. [1]what is actually ExceptionAddress is? does it the address of function / code that gives exception, or the memory address that some function tried to access? [2]is there any better mechanism that could give me better information when unhandled exception occured? (I can't use debug mode or add any code that affect runtime performance, since crash is rare and only on release build when code run as fast as possible) [3]is there any way for me to get several callstack address when unhandled exception occured. [4]suppose ExceptionAddress has address A, and I have DLL X loaded and executed at base address A-x, and some other DLL Y at A+y, is it good to assume that crash was PROBABLY caused by code on DLL X?

    Read the article

  • C++ overloading operator comma for variadic arguments

    - by uray
    is it possible to construct variadic arguments for function by overloading operator comma of the argument? i want to see an example how to do so.., maybe something like this: template <typename T> class ArgList { public: ArgList(const T& a); ArgList<T>& operator,(const T& a,const T& b); } //declaration void myFunction(ArgList<int> list); //in use: myFunction(1,2,3,4); //or maybe: myFunction(ArgList<int>(1),2,3,4);

    Read the article

  • Recycle Freed Objects

    - by uray
    suppose I need to allocate and delete object on heap frequently (of arbitrary size), is there any performance benefit if instead of deleting those objects, I will return it back to some "pool" to be reused later? would it give benefit by reduce heap allocation/deallocation?, or it will be slower compared to memory allocator performance, since the "pool" need to manage a dynamic collection of pointers. my use case: suppose I create a queue container based on linked list, and each node of that list are allocated on the heap, so every call to push() and pop() will allocate and deallocate that node: ` template <typename T> struct QueueNode { QueueNode<T>* next; T object; } template <typename T> class Queue { void push(T object) { QueueNode<T>* newNode = QueueNodePool<T>::get(); //get recycled node if(!newNode) { newNode = new QueueNode<T>(object); } // push newNode routine here.. } T pop() { //pop routine here... QueueNodePool<T>::store(unusedNode); //recycle node return unusedNode->object; } } `

    Read the article

  • C++ overide global operator comma gives error

    - by uray
    the second function gives error C2803 http://msdn.microsoft.com/en-us/library/zy7kx46x%28VS.80%29.aspx : 'operator ,' must have at least one formal parameter of class type. any clue? template<class T,class A = std::allocator<T>> class Sequence : public std::vector<T,A> { public: Sequence<T,A>& operator,(const T& a) { this->push_back(a); return *this; } Sequence<T,A>& operator,(const Sequence<T,A>& a) { for(Sequence<T,A>::size_type i=0 ; i<a.size() ; i++) { this->push_back(a.at(i)); } return *this; } }; //this works! template<typename T> Sequence<T> operator,(const T& a, const T&b) { Sequence<T> seq; seq.push_back(a); seq.push_back(b); return seq; } //this gives error C2803! Sequence<double> operator,(const double& a, const double& b) { Sequence<double> seq; seq.push_back(a); seq.push_back(b); return seq; }

    Read the article

  • safe placement new & explicit destructor call

    - by uray
    this is an example of my codes: ` template <typename T> struct MyStruct { T object; } template <typename T> class MyClass { MyStruct<T>* structPool; size_t structCount; MyClass(size_t count) { this->structCount = count; this->structPool = new MyStruct<T>[count]; for( size_t i=0 ; i<count ; i++ ) { //placement new to call constructor new (&this->structPool[i].object) T(); } } ~MyClass() { for( size_t i=0 ; i<this->structCount ; i++ ) { //explicit destructor call this->structPool[i].object.~T(); } delete[] this->structPool; } } ` my question is, is this a safe way to do? do I make some hidden mistake at some condition? will it work for every type of object (POD and non-POD) ?

    Read the article

  • undefined C/C++ symbol as operator

    - by uray
    I notice that the character/symbol '`' and '@' is not used as an operator in C/C++, does anyone know the reason or historically why its so? if its really not used, is it safe to define those symbols as another operator/statement using #define?

    Read the article

  • C++ and,or,not,xor keywords [closed]

    - by uray
    Possible Duplicate: The written versions of the logical operators. I notice that C++ define keyword and, or, not, xor, and_eq, or_eq, not_eq and xor_eq as an alternative to &&, ||, !, ^, &=, |=, != and |=. and they're rarely used! What's wrong? Are they not portable?

    Read the article

  • C++ Coding Style Conventions Doc

    - by uray
    I need to write some coding style convention document in C++ for my team, is there any example or reference how such document is made, what should I define? which convention is should be avoided? is there any C++ coding style standard defined somewhere? or care to share some if you have one? *note: I know its been asked many time, but what I need is something like this http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html but specifically for C++

    Read the article

  • C++ Reserve Memory Space

    - by uray
    is there any way to reserve memory space to be used later by default Windows Memory Manager so that my application won't run out of memory if my program don't use space more than I have reserved at start of my program?

    Read the article

  • C++ code parser/processor library

    - by uray
    is there any library that parse a source code of C++ to produce lets say, call graph, class inheritance tree, flow control, class member list or anything as a ready to use graph or structure in code (not in diagram image). to make it more clear, suppose to generate call graph image, there will be a process like this: ` C++ source -> parser -> intermediate structure -> renderer -> call graph image ^ | [i need this] `

    Read the article

  • is there any faster way to parse than by walk each byte?

    - by uray
    is there any faster way to parse a text than by walk each byte of the text? I wonder if there is any special CPU (x86/x64) instruction for string operation that is used by string library, that somehow used to optimize the parsing routine. for example instruction like finding a token in a string that could be run by hardware instead of looping each byte until a token is found.

    Read the article

  • Visual Studio output file permissions?

    - by uray
    I'am using Visual Studio 2010, how to set or automatically change owner of the output file from Visual Studio (such as executable file) to user other than administrator? all output files currently is owned by Administrator (due to Visual studio is launch by administrative privilege), so sometime I can't delete those files due to access permissions. sometime visual studio itself can't delete it too (after i ran the executable) until few minutes, its really annoying when I need to rebuild those executable. anyone know what's the actual problem here? error message is : error LNK1168: cannot open [path to file].exe for writing

    Read the article

1