Re: functor for serializing a reg_multi_sz

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 12/13/04

  • Next message: Marc Sherman: "Re: functor for serializing a reg_multi_sz"
    Date: Mon, 13 Dec 2004 15:47:13 -0500
    
    

    "Marc Sherman" <msherman@go-eol.com> wrote in message
    news:1102965987.069130.61070@f14g2000cwb.googlegroups.com
    > Since for_each takes the predicate by value and makes copies, should I
    > also be worried about passing a reference to the vector? IOW, even
    > with the helper function you suggessted, is it dangerous that the
    > various copies refer to the same vector?

    No it's not dangerous. Your operator() is stateless - it does not matter
    which instance it is called on, as long as it's called once for each
    string in proper order. for_each guarantees the latter.

    -- 
    With best wishes,
        Igor Tandetnik
    With sufficient thrust, pigs fly just fine. However, this is not 
    necessarily a good idea. It is hard to be sure where they are going to 
    land, and it could be dangerous sitting under them as they fly 
    overhead. -- RFC 1925 
    

  • Next message: Marc Sherman: "Re: functor for serializing a reg_multi_sz"

    Relevant Pages

    • Re: pointer syntax
      ... > really passing a reference (which is like an old-school pointer, ... > a copy of the primitive's value and passing that. ... build them yourself with pointers. ... mean a var parameter, write a var parameter. ...
      (comp.lang.pascal.delphi.misc)
    • Re: Passing by reference
      ... It depends upon the reason one is passing the reference. ... instantiate all relationships via a constructor so there will always be ... I naturally think of 'getter' methods as 'knowledge ...
      (comp.object)
    • Re: Using ref
      ... the address of a variable that contains a reference to an object, ... the C version is passing the address of a variable that contains the   ... Inasmuch as the specification is unambiguous, there is a single truth. ... Every time he states the incorrect view, I will feel compelled to correct his incorrect statements. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Derived type argument to subroutine
      ... In practice, they often, but not always are. ... I can rely on the fact that arguments are passed by reference. ... Would the printed value always be 4, or is it undefined as the passing ... With an important exception, ...
      (comp.lang.fortran)
    • Re: no pointer in Java => my problem
      ... > the value you are passing is an adress and you can't change the ... When passing a reference, you don't get ... access to the pointer. ... Neither Java nor C have anything resembling this. ...
      (comp.lang.java.programmer)