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

Search:

Type: Posts; User: superbonzo

Page 1 of 57 1 2 3 4

Search: Search took 0.06 seconds.

  1. Re: [CONCEPTUAL] Gobally available Service with scoped Lifetime

    your goal is to avoid globals and singletons but your design does look like a singleton. Actually, it's something in between a global and a singleton because it misses the benefits of the standard...
  2. Replies
    3
    Views
    190

    Re: Inheritance and array allocation issue

    so, your're doing something like



    struct A{virtual void foo();};
    struct B:A{};

    int main()
    {
    A* pa = new B[2];
  3. Re: Combining header files when creating static library

    uhm, why ? header files should be minimal ( so the includer does not borrow needless dependencies increasing compilation time and possibly unwanted sideeffects ) yet complete ( so the includer never...
  4. Replies
    5
    Views
    412

    Re: Acceptable use of undefined behavior

    indeed, a "not documented" behaviour does not look like a "guarantee" to me ;)

    by "guarantee" I meant things like posix/winapi multithreading in pre-c++11, platform specific ABIs etc ...


    ...
  5. Replies
    5
    Views
    412

    Re: Acceptable use of undefined behavior

    more precisely, it's perfectly legal to reinterpret_cast pointers of basically any type ( ignoring cv qualification ), but doing basically anything with the result ( aside casting it back to the...
  6. Re: How can I convert a BMP to TIFF image without using any library

    obviously you need to get and read the documentation of each file format you want to support ( eventually limiting your code to a subset of the file format facilities, omit format checking, etc... in...
  7. Re: binary operator overloading; implicit type conversion

    if your_bool is a true bool then provide just the (explicit) conversion ( and comparison ) operator, logical operators will work correctly and automatically.
    If your_bool obeys some kind of special...
  8. Re: static variable has 2 x different addresses !!

    Igor's comment *would* still apply ( I suppose he assumed the variable declaration to be in an header file ) but it is ( and it is used ) in a single c file instead ( I forgot to mention it; I did...
  9. Re: static variable has 2 x different addresses !!

    as you described it, this seems impossible to me; the address of that dummy constant is fixed by the loader so it cannot ‘change’; how do you know that it changed ?
  10. Re: Run-Time Check Failure #2 - Stack around the variable 'ucValue' was corrupted.

    moreover,



    AFAIR fscanf_s requires the size only for strings and not %d parameters
  11. Replies
    2
    Views
    389

    Re: So Slow to clear an unordered map.

    if you're using vc++, disable safe iterator checks
    you may also try a different implementation for comparison, eg boost::unordered_map ...
  12. Re: boost::shared_ptr (returning the equivalent of NULL)

    depending on boost/VS version, passing nullptr should work.



    more or less, yes it is, more specifically



    shared_ptr<T>() // get() == 0, use_count() == 0
    shared_ptr<T>( nullptr ) // get()...
  13. Re: When is a constexpr function not constexpr?

    yes, and the “and” part is the point I was trying to make; in the OP example, the fc(4) call is NOT required to be statically evaluated



    the compiler also to some extent knows when a regular...
  14. Re: When is a constexpr function not constexpr?

    this is not correct, a constexpr function is a function that *can* ( not should/may ) be evaluated at compile time and it *must* be evaluated statically only if such evaluation is required to be so (...
  15. Re: How to resolve a specific LNK2001 error using Visual Studio 2015 (C++ project)

    assuming you cannot do the right thing ( = fix your own legacy code / wrap it around a new interface etc... ) ...

    the quick and dirty way is to edit your third party library headers by adding the...
  16. Replies
    3
    Views
    463

    Re: Out of memory problem

    even assuming no fragmentation and very optimistic free space, this means at most ~1k bytes for each PathTileNodeTypeEx instance, are you sure 16G is enough ?

    anyway, if PathTileNodeTypeEx is very...
  17. Re: concatenate int value from vector to long long int

    uhm, unless I'm missing something, no, because a reference to an automatic const int is not a constant expression ( triggering an implicit capture and hence an error ). Are you using a c++14 standard...
  18. Re: concatenate int value from vector to long long int

    AFAIK, clang is right because const int's ( and unscoped enumerations ) initialized by a constant expression are like constant expressions themselves when converted to rvalues ( eg. if no address is...
  19. Re: trying to use SFINAE to detect unimplemented abstract function

    off the top of my head, this should work ( and works on clang ), although it may not be very portable due to compilers idiosyncrasies concerning virtual member pointers ...



    #include <iostream>...
  20. Replies
    11
    Views
    1,109

    Re: Review Component Based Architecture API

    BTW, looking at the posted link, that emplace() call does look somewhat brittle, but for a different reason; that is, it's currently unspecifed whether the moved object is actually moved or not if...
  21. Replies
    11
    Views
    1,109

    Re: Review Component Based Architecture API

    no, it can't ( assuming cmp a unique_ptr ). emplace() takes both its arguments by reference perfect-forwarding them to the corresponding std:: pair constructor. So, indpendently of evaluation order,...
  22. Replies
    14
    Views
    1,269

    Re: RAD Studio difference between i++ and ++i

    indeed, according to this ( as of now, accepted ) standard proposal due for c++17, order of evaluation will be fixed for postfix and assignment expressions ( but note that this won't affect the OP...
  23. Replies
    14
    Views
    1,269

    Re: RAD Studio difference between i++ and ++i

    this doesn't make much sense to me; if your proposed language change aims at forcing the compiler to detect ALL such cases, then this is and always will be impossible in c++ ( consider an expression...
  24. Replies
    14
    Views
    1,269

    Re: RAD Studio difference between i++ and ++i

    this is impossible, generally speaking. Trivial cases aside ( that are already signaled by compilers like clang ), the compiler cannot statically check all such cases due to aliasing issues.
    ...
  25. Replies
    9
    Views
    1,092

    Re: User defined literals

    first of all, you're using the user defined literal facility the other way around people would usually expect, that is, you write -20kel to actually mean -20 degrees celsius ...

    second, the '-' is...
Results 1 to 25 of 1403
Page 1 of 57 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


HTML5 Development Center