extern "C++" { namespace std { class exception { }; } } namespace __gnu_cxx { template class new_allocator { public: typedef _Tp& reference; template struct rebind { typedef new_allocator<_Tp1> other; }; }; } namespace std { template struct char_traits; 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; long unsigned int size() const { } reference operator[](long unsigned int __n) { } }; template class basic_string { }; 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 }; class ios_base { public: class failure : public exception { }; typedef _Ios_Fmtflags fmtflags; inline fmtflags flags() const { } }; template class basic_streambuf { }; 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 { template , class Alloc = std::allocator > class basic_format; typedef basic_format format; namespace io { namespace detail { typedef ::std:: locale locale_t; template basic_format& feed (basic_format& self, T x); } } } namespace mpl_ { template< typename T, T N > struct integral_c { static const T value = N; }; struct na { }; } namespace boost { namespace mpl { using namespace mpl_; } template struct integral_constant : public mpl::integral_c { typedef integral_constant type; }; 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 optional_detail { 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 { inline int atomic_decrement( int * pw ) { return __sync_fetch_and_add( pw, -1 ); } class sp_counted_base { int use_count_; int 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(); } }; } 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 format_item { typedef ::std::basic_string string_type; 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 { 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); } 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; }