array_fail_array_access.cpp 360 B

1234567891011121314151617181920212223
  1. //
  2. // Copyright (c) 2012 Peter Dimov
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. #include <boost/shared_ptr.hpp>
  9. struct X
  10. {
  11. };
  12. template<class T> void f( T & /*t*/ )
  13. {
  14. }
  15. int main()
  16. {
  17. boost::shared_ptr<X> px( new X );
  18. f( px[ 0 ] );
  19. }