请教2个关于B2签证的问题: 1. 现在B2签证, 是不是都是1年有效,多次往返了? 2. B2签证, 会不会DS156表how long do you intend to stay in the US, 上面写着1 个月, 就真的只能最多待1个月? 我妈现在写着2个月(表以写好, 不方便再去重填了), 但是她有可能待4,5个月.
It is understood that auto_ptr should not be used with STL container. For example, it is seriously wrong to call sort from header to sort a vector>, if the implementation uses quick sort and a pivot, a copy of some element, is used. Unique_ptr has the same feature of taking ownership when copying as auto_ptr . I know that unique_ptr's assignment operator uses rvalue reference, but the same problem in the above example remains: the pivot takes ownership of some element, which is subsequently destroyed. Then the question is: is it safe to use unique_ptr with STL container? I did some search, the answer seems to be yes, but I don't know why.
【在 n***l 的大作中提到】 : 请教2个关于B2签证的问题: : 1. 现在B2签证, 是不是都是1年有效,多次往返了? : 2. B2签证, 会不会DS156表how long do you intend to stay in the US, 上面写着1 : 个月, 就真的只能最多待1个月? 我妈现在写着2个月(表以写好, 不方便再去重填了), : 但是她有可能待4,5个月.
yes, unique_ptr<> is container safe. the point is, if T is not movable, (e.g . price of moving is too big), then you use a pointer for that.
ptr of
【在 p****n 的大作中提到】 : It is understood that auto_ptr should not be used with STL container. : For example, it is seriously wrong to call sort from header to : sort a vector>, if the implementation uses quick sort and a : pivot, a copy of some element, is used. : Unique_ptr has the same feature of taking ownership when copying as auto_ptr : . I know that unique_ptr's assignment operator uses rvalue reference, but : the same problem in the above example remains: the pivot takes ownership of : some element, which is subsequently destroyed. : Then the question is: is it safe to use unique_ptr with STL container? : I did some search, the answer seems to be yes, but I don't know why.