<memory>
파일에있는 boost::shared_ptr
과 std::shared_ptr
사이에 차이가 있는지 궁금합니다.표준 <memory> 파일에서 boost :: shared_ptr과 std :: shared_ptr의 차이
25
A
답변
19
std::shared_ptr
은 tr1::shared_ptr
의 C++ 0x 형식이며 부스트의 boost::shared_ptr
은 동일해야합니다.
그러나 std::shared_ptr
는 C + +0 표준을 준수 구현에서,/다음 링크에 설명 된대로 shared_ptr
클래스에 대한 자세한 편의 동작을 할 수 있어야합니다
shared_ptr
은 일반 C++ 데이터 포인터처럼 가능한 많은 역할을하는 참조 카운트 포인터입니다. TR1 구현에는 앨리어싱 및 포인터 산술과 같은 특정 포인터 기능이 없지만 C++ 0x 버전은 이러한 기능을 추가합니다. 빠른 피상적 눈에서November 2010 Working Draft of C++0x 비록
-
, 나는
shared_ptr
유형에
operator+
와 유사한 산술 연산을 볼 수 없습니다.
관련 문제
- 1. 부스트 :: shared_ptr의 표준 컨테이너
- 2. 하여 표준 : 설정 <shared_ptr의 <T>>에서 제거 shared_ptr의 <const T>
- 3. boost :: ~ shared_ptr의 작동 방식은 무엇입니까?
- 4. C++ 0x std :: shared_ptr 대 boost :: shared_ptr
- 5. T에 의해 표준 : 설정 <shared_ptr의 <T>>에서 제거 *
- 6. std :: vector <boost :: function> with boost :: bind
- 7. std :: set 유지하기 <boost :: shared_ptr>
- 8. std :: list <boost :: variant>
- 9. 차이 : 표준 : : 예외 대 표준 : : runtime_error()
- 10. const std :: map <boost :: tuples :: tuple, std :: string>?
- 11. shared_ptr의 컨테이너에서 C++ std :: equal을 사용합니다.
- 12. 컨테이너에 대한 shared_ptr의 의미는 무엇입니까?
- 13. shared_ptr과 관리되는 언어 참조의 비교
- 14. shared_ptr의 어설의 픽셀 = 0
- 15. Boost :: bind 및 std :: copy
- 16. boost :: variant는 std :: string에서 작동합니까?
- 17. 부스트 :: shared_ptr의 의미 (복사)
- 18. 기본값 : 클래스 생성자에 shared_ptr의
- 19. MySQL의 표준 시간대 차이 선택
- 20. 진화하는 C++ std :: namespace를 처리하는 방법? 예 : std :: tr1 :: shared_ptr 대 std :: shared_ptr 대 boost :: shared_ptr 대 boost :: tr1 :: shared_ptr
- 21. std :: string :: 표준 구현 바꾸기?
- 22. C++ : std :: less <int>을 boost :: bind 및 boost :: lambda와 함께 사용하는 방법?
- 23. shared_ptr의 적절한 사용?
- 24. std :: stringstream 버그?
- 25. << 연산자를 오버로드하여 표준 출력 :
- 26. 부스트 파이썬과 shared_ptr의 벡터
- 27. 이진 파일에서 std :: string을 읽음
- 28. boost :: ptr_vector를 항상 std :: vector에서 사용해야합니까?
- 29. std :: tr1 :: array와 boost :: array의 차이점
- 30. boost :: lambda를 std :: find_if와 함께 사용하는 방법?
이것은 구현에 따라 달라질 수 있습니다. – robert
@robert 서로 바꿔서 사용할 수 있습니까? 이 구현하려고하는 http://stackoverflow.com/questions/3559412/how-to-store-different-data-types-in-one-list-c/3560884#3560884 – Pepe
@ P.R. -'std :: shared_ptr'는'tr1 :: shared_ptr'의 C++ 0x 형식이고 부스트의'shared_ptr'는 똑같이 행동해야합니다 : http://stackoverflow.com/questions/3831572/differences-between-tr1shared- ptr-and-boostshared-ptr – birryree