todo.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #//
  2. #// Boost.Pointer Container
  3. #//
  4. #// Copyright Thorsten Ottosen 2003-2005. Use, modification and
  5. #// distribution is subject to the Boost Software License, Version
  6. #// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. #// http://www.boost.org/LICENSE_1_0.txt)
  8. #//
  9. #// For more information, see http://www.boost.org/libs/ptr_container/
  10. #//
  11. 1. use splice() to speed up transfer for list
  12. 5. small usage exmaple with each class
  13. 10. update tutorial to show boost::assign link + auto_ptr
  14. 11. should find_key() be added to ptr_map?
  15. 13. transfer for set/map may need to
  16. be revisted (rg. !from.empty() precondition)
  17. 15. Some of the headlines are too big...
  18. 18. range-based sort() needs to be provided for list. use stable_sort for this purpose.
  19. 19. use flat_set,flat_map internally when certain situations arise, eg. when the size of the objects
  20. is small, eg. 4bytes (does this affect key=string?
  21. 21. map::at() should throw bad_index
  22. auto_type skal være converter-bar til std::auto_ptr<U>, if the deleter is
  23. trivial (heap_clone_allocator)
  24. (Spørg Thomas Witt om denne ændring can komme med...kan ikke ødelægge existerende kode, som
  25. vill have kaldt .release()) Kræve en hel del ambiguity resolution pga auto_ptr augument er
  26. templates og ikke non-templates! Desuden kan vi ikke bruge non-template argument, da alle
  27. converterings operatorer for auto_ptr tager en & argument og ikke en by-value!!! måske
  28. skal der blot et hack til, hvor vi tilføjer en ny ukenkt klasse og overloader kun for
  29. den, og så laver en implicit konvertering til denne i static_move_ptr
  30. The easiert implementation would be to detect its presence in the
  31. body of the range based overloads and then dispatch to that implementation.
  32. 22. hvor gode er kompilere til at optimere release() for en auto_ptr. Hvordan med move_ptr
  33. and auto_ptr interaction? Contracts må kunne fortælle kompileren at den skal
  34. genere optimeret kode
  35. template< class T >
  36. class auto_ptr
  37. {
  38. T* get() const;
  39. //
  40. // this expresses that the constructor is a no-op if
  41. // the condition is true. This might be useful in many other
  42. // context
  43. //
  44. ~auto_ptr()
  45. precondition { if( get() == 0 ) return; }
  46. T* release()
  47. postcondition { get() == 0; }
  48. }
  49. ...
  50. std::auto_ptr<T> p( new T );
  51. foo( p.release() );
  52. // don't generate destructor
  53. Does raw_storage iterator have an impact on in-place consrtcution