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

Search:

Type: Posts; User: keda

Page 1 of 4 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: weird overloaded constructor behaviour (string literal vs const char*)

    superbonzo

    I apologise for my previous post, as I have misunderstood you, at least at two points. Looking at your example again, I see that you've found a way to make a wrapper for Area that is a...
  2. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Well, I didn't specify that there were no side() or radius() functions. I suppose I could have clarified that, but I still find it uncharitable that you go along and turn my example into something...
  3. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Well, I took it to mean not member of the minimal interface. But if the point is that it should not be a member function at all, then I disagree with that point.


    Well, I think you should read...
  4. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Well yes, that's part of the garbage that comes with Java, but in addition to that, and probably because they don't care that much that they are using Java in the first place, they don't either care...
  5. Re: weird overloaded constructor behaviour (string literal vs const char*)

    We were only using Sort and iterators as an example where you are a developer making a library for containers. Its a bit of a red herring to then say that there already exist a library with...
  6. Replies
    9
    Views
    895

    Re: Template arguments

    template <typename MatTypeOne, typename MatTypeTwo>
    void funct(MatTypeOne& m1, MatTypeTwo& m2) {
    //different
    }
    template <typename MatType>
    void funct<MatType,MatType>(MatType& m1, MatType&...
  7. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Just a moment here because I think you might be mixing up two issues, one being ad-hoc polymorphism and the other being parametric polymorphism. The issue superbonzo brought up was of the latter...
  8. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Well no, I think you might be confusing inheritance with dynamic polymorphism. I'm talking about plain old inheritance:
    class X: public Y{...}
    X gets all the functions of Y at compiletime.
    ...
  9. Re: weird overloaded constructor behaviour (string literal vs const char*)

    I have read some stuff from this Andrei Alexandrescu guy and he seems to be quite innovative at doing stuff with templates. He always seems to have come up with the things I come up with, so it comes...
  10. Replies
    1
    Views
    1,038

    Strip all javascript from HTML

    Does anyone happen to have a PHP script that can strip all javascript from HTML leaving the HTML tags, but removing the attributes for scripted events and script tags?
  11. Re: Does reuse variable make program faster or save some memories?

    If you want to resuse stack space without losing readability, then you could do the following:


    void test(){
    {
    Map *m1 = new Map;
    ...
    }
    {
    Map *m2 = new...
  12. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Looking at the article, it seems like he is doing a particular kind of onion design, that I don't directly find see the usefulness of. My first thought was thats upside down. You have the host at the...
  13. Re: Template constructor with explicitly specified template parameter?

    A a = A(5.0f);
    Should do it

    edit: Sorry I was reading your post too fast, I don't think you can do that, but you can specify it in another parameter
  14. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Yes, you could say that I guess. You build up classes from smaller components in a very flexible manner, rather than having to rely on a rigid set of classes.
  15. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Plain inheritance does the same thing.
  16. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Well fine, don't use it then. I think this got way sidetracked from the original point anyway.
  17. Re: weird overloaded constructor behaviour (string literal vs const char*)

    mPhone, is not the input of the algorithm. The input is the base class, which is abstracted from.

    Yes, you are absolutely right, I overlooked that possibility, focusing on Herb's approach ignoring...
  18. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Not sure where you get that impression. How is my algorithm "binding" to the objects they act upon? What do you mean by "binding"?


    Yes. Consider an algorithm sort, which we want to use for...
  19. Replies
    10
    Views
    1,672

    Re: How to sort linked list?

    Merge sort is a divide and conquer strategy. You subdivide the list into small lists, typically so small that insertion sort is faster on them, then you merge them two and two, having a pointer on...
  20. Re: weird overloaded constructor behaviour (string literal vs const char*)

    No, the function wasn't made a template, the class was. Therein lies the difference, and I think you might have misunderstood what is meant with partially generic. Partial genericity allows multiple...
  21. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Yes, however that's not really what I'm talking about. While you do not lose anythign performance-wise, you do lose opportunities of extension which is the argument behind thte claim that it...
  22. Re: Initializing an array of class objects with...

    Some people like to write
    klass *object[32];
    rather than
    klass* object[32];
    because it makes more sense when you declare several:
    klass *object[32], *object2[32];


    btw isn't class a reserved...
  23. Thread: odd gdb behaviour

    by keda
    Replies
    8
    Views
    1,019

    Re: odd gdb behaviour

    Thanks, that's informative.
  24. Thread: odd gdb behaviour

    by keda
    Replies
    8
    Views
    1,019

    Re: odd gdb behaviour

    Well, apparently the problem seems to be here:


    template <typename A,typename B,typename C>
    struct D{
    //inline D& operator=(const D<A,B,C>& p){cout << "blah"<<endl;return *this;}...
  25. Re: weird overloaded constructor behaviour (string literal vs const char*)

    Yes, its just that while he identifies the problem correctly he provides the wrong solution (and looking at those links apparently a lot of people seems to be doing this). Don't strip out members....
Results 1 to 25 of 78
Page 1 of 4 1 2 3 4





Click Here to Expand Forum to Full Width

Featured