/* Copyright 2020 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #include #if !defined(BOOST_NO_CXX11_ALLOCATOR) #include #include template struct Allocator { typedef T value_type; Allocator() BOOST_NOEXCEPT { } template Allocator(const Allocator&) BOOST_NOEXCEPT { } T* allocate(std::size_t size) { return static_cast(::operator new(sizeof(T) * size)); } void deallocate(T* ptr, std::size_t) { ::operator delete(ptr); } }; template bool operator==(const Allocator&, const Allocator&) BOOST_NOEXCEPT { return true; } template bool operator!=(const Allocator&, const Allocator&) BOOST_NOEXCEPT { return false; } int main() { boost::numeric::ublas::matrix > > matrix(4, 4); matrix(1, 2) = 3; } #endif