Search:

Type: Posts; User: plutino

Search: Search took 0.00 seconds.

  1. Replies
    14
    Views
    2,715

    wow, that's a clever implementation. Thank you. ...

    wow, that's a clever implementation. Thank you. But it's too complicated for a simple implementation that I'm looking for. I will just skip C arrays since I will probably never use them directly...
  2. Replies
    14
    Views
    2,715

    Thanks for the clarifications, especially on C++...

    Thanks for the clarifications, especially on C++ array definition. These functions are used by a Debug class to dump random user data into a file stream.
  3. Replies
    14
    Views
    2,715

    This sounds like a dead end. I'm trying to plug...

    This sounds like a dead end. I'm trying to plug this debug class in a old code set. Most part of the code has already used a stripped-down version of the vector class, but some older parts still...
  4. Replies
    14
    Views
    2,715

    By the way, is there a better way to handle the...

    By the way, is there a better way to handle the variable arguments function reloading than the pyramid I used? I don't want to go with the old C va_list method.
  5. Replies
    14
    Views
    2,715

    Well, these "arrays" are dynamically allocated...

    Well, these "arrays" are dynamically allocated with "new double[]". their sizes are not going to change once allocated. Maybe I should go with a non-uniform argument list, say, move the "int...
  6. Replies
    14
    Views
    2,715

    Sorry about the confusion. I don't process any...

    Sorry about the confusion. I don't process any single pointers, only need to overload it to work with arrays. I haven't thought about a class implementation, but these functions are already class...
  7. Replies
    14
    Views
    2,715

    Thanks. Multiple instantiation is not an issue,...

    Thanks. Multiple instantiation is not an issue, since these are all two-statement inline functions. However, the problem is that I don't know the array size ahead of time. If I change your...
  8. Replies
    5
    Views
    1,888

    You are right. I guess the only benefit...

    You are right. I guess the only benefit (depending on your point of view) is to make the code more compact.
  9. Replies
    5
    Views
    1,888

    I think there are some cases that benefit from...

    I think there are some cases that benefit from returning a reference. For example, I have a function to convert something to a string, and use the converted string in a string expression. I can...
  10. Replies
    6
    Views
    1,475

    I guess that the warning is about returning a...

    I guess that the warning is about returning a reference to a local variable. It has nothing to do with template. When you return a reference from a function, make sure the variable is still alive...
  11. Replies
    14
    Views
    2,715

    template overloading question

    I need to overload a function template so that it can handle between 1 to 6 arbitrary arguments. So I have these declarations:

    template<typename T>
    void f(int verbose, const T&);
    ...
  12. my bad. Just realized the code in question is...

    my bad. Just realized the code in question is not a template header.
  13. That's just for example. The real case is that...

    That's just for example. The real case is that the function is a template.

    a.hh:


    template <typename T> T func(T i){ ... }
  14. Question in including tempolate header files.

    Assume that two pieces of code use the same tempolate header. If the two pieces are compiled separately and linked together. Then there might be a duplicated definition error. How to avoid this...
Results 1 to 14 of 14