Search Results

Search found 64 results on 3 pages for 'osgx'.

Page 3/3 | < Previous Page | 1 2 3 

  • C++, is it possible to call a constructor directly, without new?

    - by osgx
    Hello Can I call constructor explicitly, without using new, if I already have a memory for object? // class Object1{char *str;public:Object1(char*str):str(str){puts("ctor");puts(str);};~Object1(){puts("dtor");puts(str);}}; Object1 ooo[2] = {Object1("I'm the first object"), Object1("I'm the 2nd")}; do_smth_useful(ooo); ooo[0].~Object1(); // call destructor ooo[0].Object1("I'm the 3rd object in place of first"); // ???? - reuse memory

    Read the article

  • Cache bandwidth per tick for modern CPUs

    - by osgx
    Hello What is a speed of cache accessing for modern CPUs? How many bytes can be read or written from memory every processor clock tick by Intel P4, Core2, Corei7, AMD? Please, answer with both theoretical (width of ld/sd unit with its throughput in uOPs/tick) and practical numbers (even memcpy speed tests, or STREAM benchmark), if any. PS it is question, related to maximal rate of load/store instructions in assembler. There can be theoretical rate of loading (all Instructions Per Tick are widest loads), but processor can give only part of such, a practical limit of loading.

    Read the article

  • Storing objects in STL vector - minimal set of methods

    - by osgx
    Hello What is "minimal framework" (necessary methods) of object, which I will store in STL <vector>? For my assumptions: #include <vector> #include <cstring> using namespace std; class Doit { private: char *a; public: Doit(){a=(char*)malloc(10);} ~Doit(){free(a);} }; int main(){ vector<Doit> v(10); } gives *** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0804b008 *** Aborted and in valgrind: malloc/free: 2 allocs, 12 frees, 50 bytes allocated.

    Read the article

  • c++ delete[] and array of objects

    - by osgx
    Hello I have allocated and array of Objects Objects *array = new Objects[N]; How should I delete this array? Just delete[] array; or with iterating over array's elements? for(int i=0;i<N;i++) delete array[i]; delete[]; Thanks

    Read the article

  • Unified Parallel C - examples and list of extensions

    - by osgx
    Hello Where can I find examples of code, written in "Unified Parallel C"? I also interested in normative documents about this language (standards, reference manuals, online-accessible books and courses). What extensions were added to C to get UPC? Is this dialect alive or dead?

    Read the article

  • C++ syntax of constructors " 'Object1 a (1, Object1(2))''

    - by osgx
    Hello I have a such syntax in program class Object1 : BaseClass { BaseClass *link; int i; public: Object1(int a){i=a;} Object1(int a, Object1 /*place1*/ o) {i=a; link= &o;} }; int main(){ Object1 a(1, /*place2*/ Object1(2)); ... } What do I need in place1? I want to save a link (pointer) to the second object in the first object. Should I use in place1 reference "&"? What type will have "Object1(2)" in place2? Is it a constructor of the anonymous object? Will it have a "auto" storage type?

    Read the article

< Previous Page | 1 2 3