// Copyright (C) 2008-2017 Lorenzo Caminiti // Distributed under the Boost Software License, Version 1.0 (see accompanying // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt). // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html #include "separate_body.hpp" #include //[separate_body_cpp template void array::constructor_body(unsigned count) { for(unsigned i = 0; i < count; ++i) values_[i] = T(); size_ = count; } template void array::destructor_body() { delete[] values_; } template void array::push_back_body(T const& value) { values_[size_++] = value; } /* ... */ //] template unsigned array::size_body() const { return size_; } int main() { array a(2); assert(a.size() == 2); a.push_back('x'); assert(a.size() == 3); return 0; }