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

Search:

Type: Posts; User: monarch_dodra

Page 1 of 80 1 2 3 4

Search: Search took 0.08 seconds.

  1. Replies
    8
    Views
    300

    Re: anonymous namespace qualifier

    I see. That's interesting.

    Well, I think I have my answers in regards to the original issue. Thanks all.
  2. Replies
    2
    Views
    2,801

    Re: please explain output

    Sounds like homework. In any case, it's a simply recursive calls crazy in a tree like fashion, "in-order".

    Simply tracing your code with a pen and paper would help here:




    ...
  3. Replies
    8
    Views
    300

    Re: anonymous namespace qualifier

    With my MinGW, both std=c++98 and std=C++11 produce the same output. Were namespace rules changed with C++11? I am not aware of any changes being made to them with this latest release. Are you...
  4. Replies
    8
    Views
    300

    Re: anonymous namespace qualifier

    Yeah, but it still creates a block you have to track where it opens and closes. Not a huge deal, I agree, but it feels a bit messy.



    Really? Because that doesn't compile for me...

    Using GCC.
  5. Replies
    8
    Views
    300

    anonymous namespace qualifier

    It has recently been brought to my attention that it is possible to use a namespace as a "qualifier" in the signature of a definition as opposed to using a block. EG:


    //Begin declarations here...
  6. Replies
    5
    Views
    450

    Re: initializing a POD bitfield struct

    Nice link.



    Thank you very much (both). That was a real complete and helpful answer.
  7. Replies
    5
    Views
    450

    Re: initializing a POD bitfield struct

    Well, S isn't necessarily something I own. And if at all possible, I'd rather it stay a POD.
  8. Replies
    5
    Views
    450

    initializing a POD bitfield struct

    I'm wondering what is the "best" way to initialize a bitfield struct. I have this bitfield, defined as:


    struct S
    {
    unsigned int a : 1;
    unsigned int b : 1;
    };

    If I'm "using" the...
  9. Re: Pasting "-" does not give a valid preprocessing token

    Interesting. Good point.



    Ah... Now THERE is a good solution... Unfortunately, I gave you a reduced use case. Inside actual code, the "-" is (potentially) at call site:


    std::cout <<...
  10. Pasting "-" does not give a valid preprocessing token

    I'm porting a macro from VS to GCC. The macro is pretty trivial: Take A and B, and create "A-B":


    #include <iostream>

    #define QUOTE1(A) #A
    #define QUOTE2(A, B) QUOTE1(A##-##B)

    int main()
    {
  11. Replies
    6
    Views
    675

    Re: Struct with internal linkage

    That'd be my "go to" solution, if it was legal C++.

    GCC gives:
    error: a storage class can only be specified for objects and functions

    VStudio compiles, but emits:
    warning C4091: 'static ' :...
  12. Replies
    6
    Views
    675

    Re: Struct with internal linkage

    Derp.

    Thanks.
  13. Replies
    6
    Views
    675

    Struct with internal linkage

    Hi all (long time no see)

    I've been wondering about something for a while:

    Is it possible to declare a struct/class, in a cpp file, designed for local use, but with internal linkage?

    The...
  14. Replies
    4
    Views
    440

    Re: A question regarding try/catch

    You could try the "update the return value as you go" scheme:



    ReturnType foo()
    {
    ReturnType return_val = a;
    try{
    return_val = b;
    if...
  15. Replies
    25
    Views
    1,654

    Re: Best Variable to Use

    I wanted to add to always, always, be very very careful with values "that can only hold two states". Unless your variable actually holds a representation of "true/false", more often that not, it ends...
  16. Replies
    3
    Views
    414

    Re: fstream problems

    http://www.cplusplus.com/reference/iostream/fstream/fstream/

    "app (append) : Set the stream's position indicator to the end of the stream before each output operation."

    You want ate:
    "ate (at...
  17. Replies
    6
    Views
    1,113

    Re: template classes and inline methods

    In this case "MyConst" will probably get inlined anyways, but imagining that MyConst was complex, then the usual method is to create a "non template X" where x is one of:
    a)Base class
    b)Standalone...
  18. Replies
    51
    Views
    4,020

    Re: Interview Questions

    Your logic is wrong. I agree with 1 and 2, but 3 is in direct conflict with 2.

    By making all your methods virtual, you are allowing users to "hijack" them by over-riding them. Once you have...
  19. Re: Compiler auto correct uninitialized variable? (gcc does and VC++ doesn't)

    No:
    "in the 2nd case the value of the char dlm will be set only when the if statement holds true".
    "otherwise it should be undefined": "undefined" is not a special spectral value that crashes a...
  20. Replies
    6
    Views
    512

    Re: rename_file vs move_file

    I wish, but this current project has the following restraints:
    1) No templates due to compiler limitations.
    2) No non in-house code.
    EDIT: 3) No exceptions.
    :(

    It's basically "C with classes...
  21. Replies
    6
    Views
    512

    Re: rename_file vs move_file

    Hum...

    Move it is then!

    Thanks
  22. Replies
    6
    Views
    512

    rename_file vs move_file

    I am writing a little OS agnostic library for my team for manipulating files.

    One such function is used to move/rename files (only files, not dirs). I got into a little argument with a colleague...
  23. Replies
    3
    Views
    339

    Re: find a type based on value ?

    Why wouldn't it?
  24. Replies
    6
    Views
    854

    Re: Subclassing from std::exception

    Rule of thumb:
    *If it starts with an underscore, then it is not standard.
    *If it starts with 2 underscores, then it is not standard, and compiler specific.
  25. Re: Public and private functions with no class?

    If they are templates, then everything goes into .h files. There will be no .cpp file, unless you have parts that don't depend on a parametrized type.

    The standard thing to do is usually to put...
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center