typedef long int ptrdiff_t; typedef long unsigned int size_t; namespace std { using ::size_t; extern "C" { typedef struct { } pthread_mutexattr_t; } template struct char_traits; typedef struct { } mbstate_t; typedef ptrdiff_t streamsize; template class fpos { }; template class __normal_iterator { }; template inline const _Tp& min(const _Tp& __a, const _Tp& __b) { } } extern "C++" { namespace std { class exception { }; } } namespace __gnu_cxx { template class new_allocator { public: typedef size_t size_type; typedef _Tp& reference; template struct rebind { typedef new_allocator<_Tp1> other; }; }; } namespace std { template class allocator: public __gnu_cxx::new_allocator<_Tp> { }; template struct _Vector_base { typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type; }; template > class vector : protected _Vector_base<_Tp, _Alloc> { typedef _Vector_base<_Tp, _Alloc> _Base; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; public: typedef _Tp value_type; typedef typename _Tp_alloc_type::reference reference; typedef size_t size_type; size_type size() const { } reference operator[](size_type __n) { } }; } namespace std { template class basic_string { }; } namespace std { class locale { }; enum _Ios_Fmtflags { _S_boolalpha = 1L << 0, _S_dec = 1L << 1, _S_fixed = 1L << 2, _S_hex = 1L << 3, _S_internal = 1L << 4, _S_left = 1L << 5, _S_oct = 1L << 6, _S_right = 1L << 7, _S_scientific = 1L << 8, _S_showbase = 1L << 9, _S_showpoint = 1L << 10, _S_showpos = 1L << 11, _S_skipws = 1L << 12, _S_unitbuf = 1L << 13, _S_uppercase = 1L << 14, _S_adjustfield = _S_left | _S_right | _S_internal, _S_basefield = _S_dec | _S_oct | _S_hex, _S_floatfield = _S_scientific | _S_fixed, _S_ios_fmtflags_end = 1L << 16 }; enum _Ios_Openmode { _S_beg = 0, _S_cur = 1, _S_end = 2, _S_ios_seekdir_end = 1L << 16 }; class ios_base { public: class failure : public exception { }; typedef _Ios_Fmtflags fmtflags; static const fmtflags internal = _S_internal; inline fmtflags flags() const { } inline streamsize width() const { } }; template class basic_streambuf { }; } extern "C++" { namespace __cxxabiv1 { class type_info { bool operator==(const type_info& __arg) const { } }; } } namespace boost { namespace io { namespace detail { typedef ::std:: locale locale_t; } } } namespace std { template class basic_ios : public ios_base { }; template class basic_ostream : virtual public basic_ios<_CharT, _Traits> { public: typedef _CharT char_type; typedef basic_streambuf<_CharT, _Traits> __streambuf_type; explicit basic_ostream(__streambuf_type* __sb) { } }; } namespace boost { namespace io { } template , class Alloc = std::allocator > class basic_format; typedef basic_format format; namespace io { enum format_error_bits { bad_format_string_bit = 1, too_few_args_bit = 2, too_many_args_bit = 4, out_of_range_bit = 8, all_error_bits = 255, no_error_bits=0 }; namespace detail { template basic_format& feed (basic_format& self, T x); } } } namespace mpl_ { } namespace boost { namespace mpl { using namespace mpl_; } } namespace mpl_ { template< typename T, T N > struct integral_c { static const T value = N; }; } namespace boost{ template struct integral_constant : public mpl::integral_c { typedef integral_constant type; }; namespace detail { } } namespace mpl_ { struct na { }; } namespace boost { namespace mpl { template< bool C , typename T1 , typename T2 > struct if_c { typedef T2 type; }; template< typename T1 = na , typename T2 = na , typename T3 = na > struct if_ { private: typedef if_c< static_cast(T1::value) , T2 , T3 > almost_type_; public: typedef typename almost_type_::type type; }; } template< typename T > struct is_reference : ::boost::integral_constant { }; namespace detail { template struct lower_alignment_helper { }; } namespace optional_detail { template class aligned_storage { } ; template struct types_when_isnt_ref { typedef T * pointer_type ; } ; template struct types_when_is_ref { } ; struct optional_tag { } ; template class optional_base : public optional_tag { typedef types_when_isnt_ref types_when_not_ref ; typedef types_when_is_ref types_when_ref ; typedef typename is_reference::type is_reference_predicate ; typedef typename mpl::if_::type types ; typedef typename types::pointer_type pointer_type ; } ; } template class optional : public optional_detail::optional_base { typedef optional_detail::optional_base base ; public : typedef optional this_type ; typedef typename base::pointer_type pointer_type ; } ; template inline typename optional::pointer_type get_pointer ( optional& opt ) { } template < typename MemberType, int UniqueID = 0 > class base_from_member { protected: MemberType member; template < typename T0 , typename T1 > explicit base_from_member( T0 x0 , T1 x1 ) : member( x0 , x1 ) { } }; namespace detail { typedef int sp_int32_t; inline sp_int32_t atomic_decrement( sp_int32_t * pw ) { return __sync_fetch_and_add( pw, -1 ); for( ; ; ) { } } class sp_counted_base { sp_int32_t use_count_; sp_int32_t weak_count_; public: sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) { } void release() { if( atomic_decrement( &use_count_ ) == 1 ) { } } }; class shared_count { private: sp_counted_base * pi_; public: shared_count(): pi_(0) { } template shared_count(P p, D d): pi_(0) { if( pi_ != 0 ) pi_->release(); } shared_count & operator= (shared_count const & r) { } }; } template class shared_ptr { public: typedef T element_type; template shared_ptr(Y * p, D d): px(p), pn(p, d) { } T * px; boost::detail::shared_count pn; }; namespace io { template class basic_altstringbuf : public ::std::basic_streambuf { }; template class basic_oaltstringstream : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >, public ::std::basic_ostream { class No_Op { }; typedef ::std::basic_ostream stream_t; typedef boost::base_from_member > > pbase_type; typedef basic_altstringbuf stringbuf_t; public: typedef Alloc allocator_type; basic_oaltstringstream() : pbase_type(new stringbuf_t), stream_t(rdbuf()) { } basic_oaltstringstream(stringbuf_t * buf) : pbase_type(buf, No_Op() ), stream_t(rdbuf()) { } stringbuf_t * rdbuf() const { } }; namespace detail { template struct stream_format_state { }; template struct format_item { typedef ::std::basic_string string_type; static std::streamsize max_streamsize() { } int argN_; string_type res_; }; } } template class basic_format { public: typedef Ch CharT; typedef std::basic_string string_type; typedef io::detail::format_item format_item_t; typedef io::basic_altstringbuf internal_streambuf_t; explicit basic_format(const Ch* str=__null); template basic_format& operator%(const T& x) { return io::detail::feed(*this,x); } std::vector items_; int cur_arg_; internal_streambuf_t buf_; boost::optional loc_; }; namespace io { class format_error : public std::exception { }; namespace detail { template< class Ch, class Tr, class Alloc, class T> void put( T x, const format_item& specs, typename basic_format::string_type& res, typename basic_format::internal_streambuf_t & buf, io::detail::locale_t *loc_p = __null) { basic_oaltstringstream oss( &buf); const std::ios_base::fmtflags fl=oss.flags(); const bool internal = (fl & std::ios_base::internal) != 0; const std::streamsize w = oss.width(); const bool two_stepped_padding= internal && (w!=0); if(! two_stepped_padding) { } } template< class Ch, class Tr, class Alloc, class T> void distribute (basic_format& self, T x) { for(unsigned long i=0; i < self.items_.size(); ++i) { if(self.items_[i].argN_ == self.cur_arg_) { put (x, self.items_[i], self.items_[i].res_, self.buf_, boost::get_pointer(self.loc_) ); } } } template basic_format& feed (basic_format& self, T x) { distribute (self, x); } } } } int main() { boost::format f("%d\n"); f %-123; }