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 49 1 2 3 4

Search: Search took 0.05 seconds.

  1. Re: adding rational number using only class functions

    that code is not a good example because it's counterintuitive with or without unsigneds; a reviewer seeing that loop will always end up asking himself "what happens when points.size() equals 0 or is...
  2. Replies
    5
    Views
    168

    Re: [del..............]

    hard to tell withouth knowing the type of grid,x,xi,y,yi.

    that said, if grid is a std::vector ( or something equivalent ) then an out of bound std::vector::operator[] access gives undefined...
  3. Re: what is std::container_base12 and std::container_base0

    no, it has not been solved; the c++ standard library does not define an ABI so passing std::string ( or any other container ) across DLL boundaries is dangerous at best; any change in the compiler...
  4. Re: algorithm for grouping different elements from multi dimensional matrix

    not much; let's clarify, you said

    1) "an mxm...xm matrix", so are all dimension the same ? ( you initial example was not )
    2) "group them into buckets of E elements", but then you group "c5" into...
  5. Re: algorithm for grouping different elements from multi dimensional matrix

    as it is formulated, the problem solution seems not depending on the initial configuration, IOW, it's equivalent to finding *any* disposition of elements satisfying 1. and 2. in a given *empty*...
  6. Re: link error although all constructors appear to be there

    the error is not saying that a constructor is missing, it says that the std::allocator<T>::construct() member is. Regarding why it is so, it may be due to missing std headers ( are you using a...
  7. Re: cast Base class pointer to derived class pointer: when will this fail

    I thought you meant that dynamic_cast is silently hiding ( or deferring at runtime ) possibly dangerous "errors" catched by static_cast.
    My example shows that this is not the case because the result...
  8. Re: cast Base class pointer to derived class pointer: when will this fail

    nope, those are not compile time errors, consider the following example:



    struct A{ virtual ~A() = default; };
    struct B: private A { A* get(){return this;} } b;
    struct C: A { A* get(){return...
  9. Re: cast Base class pointer to derived class pointer: when will this fail

    in the sense that he will die from fear when his program will crash for no apperent reason ... :) dynamic_cast is required to perform NO runtime check when the destination and source types are the...
  10. Re: cast Base class pointer to derived class pointer: when will this fail

    actually, g++ is correct ( although the error message is not very informative in this case ), as the clause continues as



    EDIT: uhm sorry, I misread 2kaud and laserlight's posts, that do not...
  11. Replies
    6
    Views
    309

    Re: recursive crashes + debug problem

    no, it does not return "1.8" because such a number cannot be stored into a double. Instead, it's rounded to the nearest representable value in an implementation defined way, that is very close but...
  12. Replies
    6
    Views
    309

    Re: recursive crashes + debug problem

    most probably ( witout seeing the generated asm we can only conjecture ) yes it's stack overflow; in release mode you don't see the error because the compiler has applyed a so called tail recursion...
  13. Replies
    6
    Views
    387

    Re: template operation issue

    what do you mean ? the OP error has nothing to do with type completeness. In general, when a friend function is defined inside a class it's injected in the enclosing namespace; for class templates,...
  14. Replies
    6
    Views
    387

    Re: template operation issue

    as it is, you're injecting a different template function specialization for each instantiation of foo ( if such a thing makes sense at all :) aah, template friends )

    one way should be to define it...
  15. Replies
    8
    Views
    512

    Re: How to partitioning a list

    uhm, no, the fact that an algorithm is NP-complete does not mean that it doesn't have a polynomial ( avarage or worst case ) solution for given subset of input, or input distribution.

    Indeed, the...
  16. Thread: .h and .cpp

    by superbonzo
    Replies
    51
    Views
    2,357

    Re: .h and .cpp

    @laserlight, you're right as always :) ; although it's fair to assume that when people speaks about the "STL" they effectively mean the c++ standard library ( at least its templated part ) ... ( as...
  17. Thread: .h and .cpp

    by superbonzo
    Replies
    51
    Views
    2,357

    Re: .h and .cpp

    because, ehm, it's the standard template library, so there's simply no alternative as far as its templates are concerned;

    moreover, it's not true at all that the STL is header only; it has a...
  18. Replies
    8
    Views
    512

    Re: How to partitioning a list

    note that the redundancy of the solution could work in your favour for a big list of marginally uniformly distributed numbers and a sufficiently small N.

    more specifically, given the input list...
  19. Replies
    1
    Views
    228

    Re: Finding valley in 2D height map

    as far as I can tell, it's a variation of the flood fill algorithm ( you can google it; there's also an equivalent problem in graph theory whose name I cannot recall now ) with some special easily...
  20. Replies
    5
    Views
    416

    Re: Solution of a recurrence relation

    to convince yourself that it's indeed O(n^2), it's easier to just write down the number of times "c" is incremented for a given n ...

    moreover, note that,in general, given

    Function(n)...
  21. Thread: .h and .cpp

    by superbonzo
    Replies
    51
    Views
    2,357

    Re: .h and .cpp

    if by "functionally equivalent" you mean that the build process will behave the same ( in terms of compilation speed, size, correctness, generality ) then no, for the previously mentioned reasons.
    ...
  22. Replies
    18
    Views
    839

    Re: [RESOLVED] map iterators

    it's still wrong, the line



    if (piter == OPTITER()) {


    will evaluate to true if piter is set to OPTITER()
    but, it will evaluate to false IF it was set to any other map instance iterator...
  23. Replies
    18
    Views
    839

    Re: [RESOLVED] map iterators

    you're totally right :blush:, actually my reasoning in my last post just implies that IF the comparison is well defined ( the standards says, "it's in the == domain" ) THEN it must follows that the...
  24. Thread: .h and .cpp

    by superbonzo
    Replies
    51
    Views
    2,357

    Re: .h and .cpp

    then I'm not sure we're following each other :) I'l try to rephrase if I explained myself badly



    they are not equivalent for two reasons

    1) unless you template or you ( or the compiler )...
  25. Thread: .h and .cpp

    by superbonzo
    Replies
    51
    Views
    2,357

    Re: .h and .cpp

    it’s not an “advantage”, it’s your only option if you want your header to be used in more than one TU, and ( supposing you want your code to be reused by you or others, in any scenario ) you should...
Results 1 to 25 of 1225
Page 1 of 49 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center