Re: functor for serializing a reg_multi_sz
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 12/13/04
- Previous message: Victor Bazarov: "Re: template<T>f(T, T): passing array pointer"
- In reply to: Marc Sherman: "Re: functor for serializing a reg_multi_sz"
- Next in thread: Jeff F: "Re: functor for serializing a reg_multi_sz"
- Messages sorted by: [ date ] [ thread ]
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
- Previous message: Victor Bazarov: "Re: template<T>f(T, T): passing array pointer"
- In reply to: Marc Sherman: "Re: functor for serializing a reg_multi_sz"
- Next in thread: Jeff F: "Re: functor for serializing a reg_multi_sz"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|