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

Search:

Type: Posts; User: HighCommander4

Page 1 of 55 1 2 3 4

Search: Search took 0.40 seconds.

  1. Re: Searching through a CSV file

    That depends on whether or not the OP needs the entries of mIndex to be processed in the order they appear in mIndex. If not, then yes, this would be even faster.
  2. Re: Why does std::vector require its elements to be assignable?

    The same reason C++ arrays aren't like Java arrays: we want to avoid extra allocations when not necessary.
  3. Re: Searching through a CSV file

    You are reading the file over and over again for each index. There is no need to do that.

    My suggestion would be:
    1) Read the file once, and store it in memory in a map<string, string>, where...
  4. Re: Why does std::vector require its elements to be assignable?

    For what it's worth, the C++0x standard specifies fine-grained requirements for each of the STL container member functions rather than imposing requirements on the container as a whole. In...
  5. Replies
    3
    Views
    7,918

    Re: Decoding data from a TCP/IP Packet

    If you need to do the capture in code, you should look at the WinPCAP library and its C# wrapper, PCAP.NET.

    (p.s. HighCommander4 is sad because he liked his post count being 1337 :D).
  6. Replies
    3
    Views
    981

    Distributed enums

    Hello, it's nice to be back :wave:

    I have a distributed system consisting of many processes, and I am designing a mechanism by which they can all send messages to a "monitor" process.

    Each...
  7. Declaring derived class destructor virtual

    I know it is only necessary to declare a method as virtual in the base class, and the overridden version in the derived class will automatically be virtual.

    Does this apply to destructors as well?...
  8. Re: Get decltype to deduce member variable constness

    The first makes no difference.

    The second gives the error "invalid use of 'this' at top level".

    Perhaps it's just my compiler that doesn't support this feature fully? I am using g++ 4.4.
  9. Get decltype to deduce member variable constness

    Consider the following code:


    template <typename T>
    class really_long_complicated_typename
    {
    public:
    really_long_complicated_typename(T& x) : x(x) {}
    private:
    T& x;
  10. Re: Help - how to initialize reference variable?

    Really? In my experience, the compiler can still auto-generate a copy constructor, since references can be copy-constructed. It is only the assignment operator that the compiler cannot generate.
    ...
  11. Replies
    22
    Views
    3,237

    Re: WHich one is evaluated first

    From the Wikipedia page of C++0x:



    So it's not that bad.

    And as far as I'm aware, the C++0x committee goes out of its way not to break existing code.
  12. Re: Know of any good free beautifiers (pretty printers)?

    I'm not a VS user, but a quick google search reveals that it's under Edit->Advanced->Format Document.
  13. Re: Change program so heading function works

    I'm assuming you also want it to print out the stuff in the function 'heading'.

    To do this, you need to call 'heading' from 'main'. The code you wrote so far only defines the function 'heading',...
  14. Re: Change program so heading function works

    You'll have to be a little more specific...

    What do you expect it to do? What does it do right now?
  15. Re: Know of any good free beautifiers (pretty printers)?

    What are you looking to beautify? If it's C++ code, then most IDEs (e.g. eclipse, Visual Studio) have a "Format" feature that formats the code according to conventions that you can (usually)...
  16. Replies
    6
    Views
    767

    Re: Im losing a .01 somewhere

    Or you could use the standard library function nearbyint().
  17. Replies
    7
    Views
    1,004

    Re: What happens to resources on a fork?

    Don't beat yourself up :) *nix internals are tricky (well, all OS internals are...)
  18. Replies
    7
    Views
    1,004

    Re: What happens to resources on a fork?

    I never said the file descriptors were the same... The man page I quoted says that one is a copy of the other. On the other hand, they point to the same file description - the file description is not...
  19. Replies
    7
    Views
    1,004

    Re: What happens to resources on a fork?

    Nope. There is a subtle difference between file descriptors and file descriptions. A file description is data structure in the kernel which stores information about an open file such as the current...
  20. Replies
    7
    Views
    1,004

    Re: What happens to resources on a fork?

    From the man page for fork:



    I'm no expert, but I think this effectively means that it is safe for either the child or the parent to use the file/socket, but not both (the one that doesn't use...
  21. Re: NOT WORK: void foo(const typename T::ENUM&)

    Note that you can get your original version to work if you provide the enumeration name in the function declaration (SOME_PARENT::MyEnum instead of SOME_PARENT::SOME_ENUM) and you provide the...
  22. Replies
    22
    Views
    3,237

    Re: WHich one is evaluated first

    Very true, but I'm sure you meant to declare p as some class type rather than int... ;)
  23. Re: What C++ compiler do you use and which you think is the best?

    I will, gladly. :D

    I use Eclipse CDT with gcc. Besides both of them (eclipse and gcc) being cross-platform, Eclipse CDT has an internal parser which parses your code on the fly and applies syntax...
  24. Replies
    11
    Views
    4,194

    Re: some problem with boost::bind.

    Interesting, I didn't know about std:: ptr_fun.

    However, since it only transforms pointers to functions into functors (as opposed to anything function-like into a functor), it must still be used...
  25. Re: compile error (with minimal but complete example)

    I don't know much about how compilers work, but would it make writing compilers much more difficult, or would it make them much slower (because they would have to do more passes) if they were...
Results 1 to 25 of 1354
Page 1 of 55 1 2 3 4





Click Here to Expand Forum to Full Width

Featured