Axiom 3: Swap Doesn't Throw





Axiom 3: Swap Doesn't Throw

This is another socially based axiom, but it's not as ingrained and universally recognized as the prohibition on destructors and deletions that throw. Swapping would not seem to be a very common operation, but it is used extensively "behind the scenes," most particularly in STL implementations. Whenever you perform a sort, reverse, partition, or any of a large number of other operations, you're swapping, and an exception safe swap goes a long way toward guaranteeing that these operations will be exception safe as well. See also Copy Operations [13, 45].


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows