mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
new files
[SVN r8685]
This commit is contained in:
parent
e3d9745df1
commit
0c3bc42bec
27
iter_adaptor_fail_expected1.cpp
Normal file
27
iter_adaptor_fail_expected1.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
// Test boost/pending/iterator_adaptors.hpp
|
||||
|
||||
// (C) Copyright Jeremy Siek 1999. Permission to copy, use, modify,
|
||||
// sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
// Revision History
|
||||
// 21 Jan 01 Initial version (Jeremy Siek)
|
||||
|
||||
#include <list>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pending/iterator_adaptors.hpp>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef boost::iterator_adaptor<int*, boost::default_iterator_policies,
|
||||
boost::iterator<std::bidirectional_iterator_tag, int> > adaptor_type;
|
||||
|
||||
adaptor_type i;
|
||||
i += 4;
|
||||
return 0;
|
||||
}
|
28
iter_adaptor_fail_expected2.cpp
Normal file
28
iter_adaptor_fail_expected2.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
// Test boost/pending/iterator_adaptors.hpp
|
||||
|
||||
// (C) Copyright Jeremy Siek 1999. Permission to copy, use, modify,
|
||||
// sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
// Revision History
|
||||
// 21 Jan 01 Initial version (Jeremy Siek)
|
||||
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pending/iterator_adaptors.hpp>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef boost::iterator_adaptor<int*, boost::default_iterator_policies,
|
||||
boost::iterator<std::input_iterator_tag, int> > adaptor_type;
|
||||
|
||||
adaptor_type iter;
|
||||
--iter;
|
||||
return 0;
|
||||
}
|
32
iter_adaptor_fail_expected3.cpp
Normal file
32
iter_adaptor_fail_expected3.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
// Test boost/pending/iterator_adaptors.hpp
|
||||
|
||||
// (C) Copyright Jeremy Siek 1999. Permission to copy, use, modify,
|
||||
// sell and distribute this software is granted provided this
|
||||
// copyright notice appears in all copies. This software is provided
|
||||
// "as is" without express or implied warranty, and with no claim as
|
||||
// to its suitability for any purpose.
|
||||
|
||||
// See http://www.boost.org for most recent version including documentation.
|
||||
|
||||
// Revision History
|
||||
// 21 Jan 01 Initial version (Jeremy Siek)
|
||||
|
||||
#include <list>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pending/iterator_adaptors.hpp>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
|
||||
class foo {
|
||||
public:
|
||||
void bar() { }
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef boost::iterator_adaptor<foo*, boost::default_iterator_policies,
|
||||
boost::iterator<std::input_iterator_tag, foo> > adaptor_type;
|
||||
|
||||
adaptor_type i;
|
||||
i->bar();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user