From d236763a6ae69b1b5cac8126a9fc572b46c570ff Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 30 Jul 2026 15:50:48 +0200 Subject: [PATCH] o3tl: Drop unused lazy_update.hxx This was only used in the simplecanvas library that was dropped in Change-Id: I301b3a42dfb6eacf6a9ef3a4851ed1d38f16ec66 Author: Michael Weghorn 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 --- include/o3tl/lazy_update.hxx | 89 --------------------------------- o3tl/README.md | 6 --- solenv/clang-format/excludelist | 1 - 3 files changed, 96 deletions(-) delete mode 100644 include/o3tl/lazy_update.hxx diff --git a/include/o3tl/lazy_update.hxx b/include/o3tl/lazy_update.hxx deleted file mode 100644 index 6f9325dfd17e..000000000000 --- a/include/o3tl/lazy_update.hxx +++ /dev/null @@ -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 - -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 -
-LazyUpdate myValue(F);
-*myValue = newInput;
-myValue->updateInput( this, that, those );
-
-output( *myValue );
-        
- or -
-output( myValue.getOutValue() );
-        
- if the compiler does not recognize the const context. - */ - template 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: */ diff --git a/o3tl/README.md b/o3tl/README.md index dccfc6028d91..94b6d1b96951 100644 --- a/o3tl/README.md +++ b/o3tl/README.md @@ -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. diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 8967017557ae..8e8725ff7d09 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -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