o3tl: Drop unused lazy_update.hxx

This was only used in the simplecanvas library
that was dropped in

    Change-Id: I301b3a42dfb6eacf6a9ef3a4851ed1d38f16ec66
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Jul 30 15:31:11 2026 +0200

        canvas: Drop unused simplecanvas library/component

Change-Id: I576c8e954d5ada273f49e9eba45dd71e65d49310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208854
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-08-01 07:37:00 +02:00
parent e6d7271741
commit d236763a6a
3 changed files with 0 additions and 96 deletions
-89
View File
@@ -1,89 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_O3TL_LAZY_UPDATE_HXX
#define INCLUDED_O3TL_LAZY_UPDATE_HXX
#include <utility>
namespace o3tl
{
/** Update output object lazily
This template collects data in input type, and updates the
output type with the given update functor, but only if the
output is requested. Useful if updating is expensive, or input
changes frequently, but output is only comparatively seldom
used.
@example
<pre>
LazyUpdate<InType,OutType,decltype(F)> myValue(F);
*myValue = newInput;
myValue->updateInput( this, that, those );
output( *myValue );
</pre>
or
<pre>
output( myValue.getOutValue() );
</pre>
if the compiler does not recognize the const context.
*/
template<typename In, typename Out, typename Func> class LazyUpdate {
public:
LazyUpdate(Func func): func_(std::move(func)), input_(), dirty_(true) {}
In const & getInValue() const { return input_; }
Out const & getOutValue() const { return update(); }
In & operator *() {
dirty_ = true;
return input_;
}
In * operator ->() {
dirty_ = true;
return &input_;
}
Out const & operator *() const { return update(); }
Out const * operator ->() const { return &update(); }
private:
Out const & update() const {
if (dirty_) {
output_ = func_(input_);
dirty_ = false;
}
return output_;
}
Func const func_;
In input_;
mutable Out output_;
mutable bool dirty_;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-6
View File
@@ -17,12 +17,6 @@ to boost, but isn't as of now)."
A copy-on-write wrapper.
- `[git:include/o3tl/lazy_update.hxx]`
This template collects data in input type, and updates the output type with the given update functor,
but only if the output is requested. Useful if updating is expensive, or input changes frequently, but
output is only comparatively seldom used.
- `[git:include/o3tl/vector_pool.hxx]`
Simple vector-based memory pool allocator.
-1
View File
@@ -5066,7 +5066,6 @@ include/o3tl/cow_wrapper.hxx
include/o3tl/enumarray.hxx
include/o3tl/enumrange.hxx
include/o3tl/functional.hxx
include/o3tl/lazy_update.hxx
include/o3tl/numeric.hxx
include/o3tl/safeint.hxx
include/o3tl/sorted_vector.hxx