Search:

Type: Posts; User: golfinguy4

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. But the standard doesn't dictate that it...

    But the standard doesn't dictate that it shouldn't either, correct? Ie, the release of memory is implementation-defined?

    Basically, I have a large unordered_map of POD pairs that is repeatedly...
  2. Oops, my mistake. I meant reserve. Good to know...

    Oops, my mistake. I meant reserve. Good to know that reserve doesn't release memory. While clear removes items, does it release the memory the unordered_map used to store them?
  3. Unordered map behavior on clear and reserve

    In one of my projects, I'm using an unordered_map where I repeatedly clear and refill it. Each time, the number of points is roughly similar (but not identical), so preventing reallocation is...
  4. Replies
    2
    Views
    882

    Compiler Inlining Question

    Say I have a simple vector class...



    class Vector3{
    public:
    Vector3();
    Vector3(float* data);
    Vector3 operator+(const Vector3& vec) const;
    Vector3 operator-(const...
  5. Replies
    5
    Views
    1,390

    Even when cast to an unsigned int, I got the same...

    Even when cast to an unsigned int, I got the same result. I never knew shifting a uint by 32 bits was undefined. Always assumed it'd be filled with 0's.
  6. Replies
    5
    Views
    1,390

    Confusing bit shifting result

    #include <iostream>

    int main(void){
    unsigned int foo = 0xFFFFFFFF;

    //i'd think these would return the same result, but
    //they don't in visual studio 2010 (debug/release). why?...
  7. Optimizing out virtual function calls at compile-time

    Will the compiler even attempt to do it? Here's the example I'm working with...



    //MY_HEADER_H
    class Base{
    public:
    virtual void method1() = 0;
    virtual void method2() = 0;
    ...
  8. Replies
    3
    Views
    1,817

    Data structures are typically dictated by the...

    Data structures are typically dictated by the algorithm. Do you know how you plan on solving the problem? As Wikipedia will tell you, there are a few ways of analyzing it.

    One of the more...
  9. Replies
    3
    Views
    1,976

    Google Code (http://code.google.com/) Always a...

    Google Code

    Always a good place to look. ;)
  10. Replies
    5
    Views
    1,547

    Ah ok, you were referring to the data in the...

    Ah ok, you were referring to the data in the class itself. Makes sense.
  11. Replies
    5
    Views
    1,547

    However, correct me if I'm wrong, std::vectors...

    However, correct me if I'm wrong, std::vectors use a contiguous block of memory and store their own copy of the data. Are you implying that the data itself may be stored non-contiguously but that...
  12. Replies
    5
    Views
    1,547

    Guaranteed Padding?

    Given a class of the form



    class DataVector
    {
    public:
    DataVector(int i, int j, int k){
    _vals[0] = i;
    _vals[1] = j;
  13. Replies
    14
    Views
    1,052

    And that's what I was looking for. Thanks.

    And that's what I was looking for. Thanks.
  14. Replies
    14
    Views
    1,052

    Thanks brewbuck. I figured what I was doing...

    Thanks brewbuck. I figured what I was doing wasn't legal, and your response confirms it. Is there an equivalent paradigm with similar encapsulation (i.e. maintaining the hidden nature of the data...
  15. Replies
    14
    Views
    1,052

    Don't worry so much about the thread-safety. I...

    Don't worry so much about the thread-safety. I know what I'm doing there, and things will be thread-safe. I'm a semi-competent programmer who went on a bit of a hiatus so things are a bit rusty. ...
  16. Replies
    14
    Views
    1,052

    I probably should have clarified. I understand...

    I probably should have clarified. I understand the need for some sort of data protection such as semaphores, critical sections, etc. I thought it was implicitly assumed one would be used in the...
  17. Replies
    14
    Views
    1,052

    Attempting to make a threadsafe construct

    Here's what I'm trying to do, but VS2008 isn't liking my forward declaration of the class (or friend member function for that matter).



    #include <iostream>


    class B;

    class A {
  18. Replies
    3
    Views
    920

    Thanks. the NVI idiom was what I was looking...

    Thanks. the NVI idiom was what I was looking for. It's been a long day...
  19. Replies
    3
    Views
    920

    Organizing Inheritance

    Here's a bit of pseudocode describing the situation I'm in...




    class Base{
    public:
    void method(){
    //do some stuff
    protectedFunc(foo);
  20. Replies
    13
    Views
    2,001

    Thanks Sebastiani and anon. I'll have to take a...

    Thanks Sebastiani and anon. I'll have to take a closer look at your responses tonight when I get a chance.
  21. Replies
    13
    Views
    2,001

    Sebastiani, Specifying all of the functors at...

    Sebastiani,

    Specifying all of the functors at once won't be an issue. While the functors themselves use variables that change during run-time, the actual functors being used are known at...
  22. Replies
    13
    Views
    2,001

    The above pseudo-code is now accurate (and was...

    The above pseudo-code is now accurate (and was accurate as of your last post).

    Error: "error C2064: term does not evaluate to a function taking 1 arguments"

    Also, even if I were to construct my...
  23. Replies
    13
    Views
    2,001

    This is just pseudo-code. I just forgot to put...

    This is just pseudo-code. I just forgot to put them in. Let me try to correct it to make it a bit more C++-ish. I should probably also note that the error I'm getting involves the functor not...
  24. Replies
    13
    Views
    2,001

    List of Functors

    I'm looking to optimize a portion of my code that is extremely time sensitive (will be running at least 1000x/s). It involves sequentially calling a series of functions to modify a given value. To...
  25. Replies
    4
    Views
    1,163

    Vista Business vs XP Pro

    I'm deciding between which OS to install on a new thinkpad laptop. Already have the laptop (with vista basic) and LEGAL versions of the respective OS's. I'll be running basic math/engineering...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4