CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: mclark

Page 1 of 2 1 2

Search: Search took 0.03 seconds.

  1. Replies
    0
    Views
    1,042

    user-defined type conversion operators

    Can anyone cite the C++ language standard rules on instantiation of templated type conversion operators?

    If I have a function bar returning type T1, and another function foo taking in type T2 and...
  2. Replies
    6
    Views
    1,673

    Thanks all... I had assumed that the typecast...

    Thanks all...

    I had assumed that the typecast required meant that I had something wrong. But as it turns out using:
    reinterpret_cast<HANDLE>(::_beginthreadex())
    works just fine!
    ...
  3. Replies
    6
    Views
    1,673

    question about _beginthreadex and handles

    I'm using the _beginthreadex interface to create some threads. According to the MSDN docs _beginthreadex returns a uintptr_t, but the docs also talk about being able to directly use the handle...
  4. Replies
    4
    Views
    1,623

    std::numeric_limits::max() returns an...

    std::numeric_limits<LONG>::max() returns an implementation defined value of type LONG that represents the largest possible positive value for the LONG datatype (ie. biggest integral value long can...
  5. Replies
    4
    Views
    1,623

    CreateSemaphore WIN32 Interface

    What is the maximum value that a semaphore can have? The CreateSemaphore takes in two LONGs for the inital and maximal value but passing in std::numeric_limits<LONG>::max() causes CreateSemaphore to...
  6. Replies
    5
    Views
    678

    I think you missed the infinite loop. Regardless...

    I think you missed the infinite loop. Regardless of container resizing - it will run out of resources and at very least a bad_alloc exception will occur.

    Graham is on the right track...

    Graham...
  7. Replies
    2
    Views
    474

    another childish 'exception' question

    if...

    int main(void) {
    int * p(some_value);

    p = new int;

    ...

    return 0;
  8. Replies
    5
    Views
    678

    'exception' question

    Can someone quickly tell me what type of exception is thrown when an STL container is full...?


    imagine...

    int main(void) {
    std::vector<int> myVec;

    // loop only exited via exception...
  9. Replies
    2
    Views
    577

    Beautiful, This is exactly the type of...

    Beautiful,

    This is exactly the type of succinct and definitive response I was looking for. Thanks for correcting my mistaken assumption!
  10. Replies
    2
    Views
    577

    question about initial values

    Ok, another question for the Standards weenies...

    I'm pretty sure I know the answer (A) but I'm gonna ask anyways.

    given...

    std::vector<int *> Vec(1);

    Vec is constructed using:
    ...
  11. I thought it was pretty clear from the first 4...

    I thought it was pretty clear from the first 4 posts that the question had indeed been answered. I guess next time I'll explicitly state "ok - thank you - I understand - the end".
  12. Wow, pretty uncreative. If you must know this...

    Wow, pretty uncreative. If you must know this code is for cloning. It comes from a reference implementation of C++ Library Extensions Technical Report 1 (tr1) - polymorphic function object...
  13. Does the following statement invoke undefined behavior?

    The example uses built-in types but of course what I really care about are user-defined types.

    This is a question about evaluation rules... I believe it is well behaved because the rhs argument to...
  14. Replies
    2
    Views
    637

    Is this code well-defined/legal?

    Can someone tell me if function argument evaulation rules make this exaple code illegal...

    class foo { public: int x; };

    void bar(foo & c, int y = c.x) {}

    note that the question is about...
  15. Replies
    279
    Views
    85,101

    I studied under Musser and did a lot of banging...

    I studied under Musser and did a lot of banging around with the HP implementation. It was a mess. That couldn't be helped. You really do need a lot of the language support added to the C++ spec to...
  16. Replies
    279
    Views
    85,101

    I think you are all missing the one key advantage...

    I think you are all missing the one key advantage STL has over any home grown solution yet it has been conclusively demonstrated here in this thread. FAMILARITY.

    Both protractors and detractors...
  17. Replies
    279
    Views
    85,101

    Yeah. The standard makes garantees only about...

    Yeah. The standard makes garantees only about the number of actual elements in the vector (calls to T's constructor) but says nothing about the vector's capacity. When a vector reserves capacity...
  18. Replies
    279
    Views
    85,101

    I do not think this refutes my claim. The...

    I do not think this refutes my claim.

    The standard guarantees that the invariant of your construct (calling a vector's range constructor) is that the size is equal to the number of elements within...
  19. Replies
    11
    Views
    1,018

    yeah, yeah I forgot leading std:: for the...

    yeah, yeah I forgot leading std:: for the example. Just add them and try it.

    What I don't understand is why...

    std::cout << i << ++i << i++ << std::endl;

    output 220 (for me at least)...
  20. Replies
    11
    Views
    1,018

    stupid basic C++ question...

    I'm sure once someone explains this to me it will all seem rational but for right now the explanation for the following output escapes me...

    #include <iostream>
    int main(void) {
    int i(0);

    ...
  21. Replies
    1
    Views
    373

    Quick question about 'using'

    Can using be used to make public a public method of an a member object?

    class foo {void bar() {}};

    class doink {public: void bar(){Foo.bar();} private: foo Foo;}

    can 'doink' be built like...
  22. Replies
    279
    Views
    85,101

    Galathaea, This thread has kinda run the gamut...

    Galathaea,

    This thread has kinda run the gamut of topics (and the odd flame). Any chance you can revisit your last post and insert some quotes so I can better understand what and whose statements...
  23. Replies
    10
    Views
    1,497

    Out of curiosity; is this dictated by the...

    Out of curiosity; is this dictated by the standard or simply compiler convention. I know the standard does provide a definition of translation unit but its not the easist doc to find stuff in...
  24. Replies
    279
    Views
    85,101

    Re: the souldog remove hole

    After a quick scan of the standard, the only other occurence of this hole is with 'unique'. Since the standard does not say that unique has to be implemented in terms of the remove family of...
  25. Replies
    279
    Views
    85,101

    the souldog remove hole

    Ok, I spent my 5 minute walk to the coffee vending machine thinking about the remove hole (yes, where I work for 35 cents you can get a large shot glass of coffee at any hour of the day or night).
    ...
Results 1 to 25 of 48
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured