w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • C, C++
  • C++
  • Utilities

std::shared_ptr::swap

void swap( shared_ptr& r );
(since C++11)

Exchanges the contents of *this and r.

Parameters

r - smart pointer to exchange the contents with

Return value

(none).

Exceptions

noexcept specification:
noexcept
Links:
  • http://en.cppreference.com/w/cpp/memory/shared_ptr/swap
doc_CPP
doc_CPP
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
std::shared_ptr Defined in header <memory> template< class T > class shared_ptr; (since C++11) std::shared_ptr is a smart pointer that ret
std::shared_ptr::shared_ptr constexpr shared_ptr(); (1) template< class Y > explicit shared_ptr( Y* ptr ); (2) template< class Y, class Deleter > shar
std::swap(std::shared_ptr) template< class T > void swap( shared_ptr<T>& lhs, shared_ptr<T>& rhs ); (since C++11) Specializes the std::swap al
std::atomic_...&lt;std::shared_ptr&gt; template< class T > bool atomic_is_lock_free( const std::shared_ptr<T>* p ); (1) (since C++11) template< class T > std::shar
std::shared_ptr::get T* get() const; (since C++11) Returns a pointer to the managed object or a null pointer if no object is being managed. Parameters (none).


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions