<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Andriy Savin</title><link>https://andsav.dev/</link><description>Recent content on Andriy Savin</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 28 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://andsav.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>C++ std module on macOS with Clang</title><link>https://andsav.dev/posts/cpp-std-module-on-macos-with-clang/</link><pubDate>Tue, 28 Apr 2026 00:00:00 +0000</pubDate><guid>https://andsav.dev/posts/cpp-std-module-on-macos-with-clang/</guid><description>&lt;p&gt;If you, like me, are modernising your C++ knowledge (or learning it for the first time) and have discovered the C++ modules feature, you probably thought: &lt;em&gt;how cool - it’s like self-contained libraries/assemblies/packages/crates from my favourite language X, which has had them forever!&lt;/em&gt; No more &lt;strong&gt;#includes&lt;/strong&gt;, which have been the source of all sorts of problems.&lt;/p&gt;
&lt;p&gt;But the first thing you’ll likely encounter is that this feature is still not fully supported across compilers. And even when it is supported, the library that should lead this transition - the standard library - may not yet be available as a ready-to-use module. This is currently the case with Clang: the standard library is not shipped as a precompiled module (as of the time of writing). Instead, it is provided as source code, typically located at a path such as &lt;em&gt;&lt;strong&gt;/usr/share/libc++/v1/&lt;/strong&gt;&lt;/em&gt; or &lt;em&gt;&lt;strong&gt;/opt/homebrew/opt/llvm/share/libc++/v1&lt;/strong&gt;&lt;/em&gt;, depending on how Clang is installed (e.g. via Xcode or Homebrew LLVM).&lt;/p&gt;</description></item><item><title>Using Decorator pattern with .Net Core dependency injection container</title><link>https://andsav.dev/posts/using-decorator-pattern-with-dotnet-core-di/</link><pubDate>Fri, 23 Feb 2018 00:00:00 +0000</pubDate><guid>https://andsav.dev/posts/using-decorator-pattern-with-dotnet-core-di/</guid><description>&lt;h3 id="tldr"&gt;TL;DR&lt;/h3&gt;
&lt;p&gt;Configure a decorator with DI as simple as this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#cad3f5;background-color:#24273a;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;services.&lt;span style="color:#8aadf4"&gt;AddDecorator&lt;/span&gt;&lt;span style="color:#91d7e3;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;IEmailMessageSender, EmailMessageSenderWithRetryDecorator&lt;span style="color:#91d7e3;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; decorateeServices &lt;span style="color:#91d7e3;font-weight:bold"&gt;=&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; decorateeServices.&lt;span style="color:#8aadf4"&gt;AddScoped&lt;/span&gt;&lt;span style="color:#91d7e3;font-weight:bold"&gt;&amp;lt;&lt;/span&gt;IEmailMessageSender, SmtpEmailMessageSender&lt;span style="color:#91d7e3;font-weight:bold"&gt;&amp;gt;&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; });
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can find the full code as well as demo application at &lt;a href="https://github.com/andriysavin/Blog/tree/main/DecoratorAndDotNetDI"&gt;https://github.com/andriysavin/Blog/tree/main/DecoratorAndDotNetDI&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="main"&gt;Main()&lt;/h3&gt;
&lt;p&gt;Imagine you need to wrap some service with a &lt;a href="https://en.wikipedia.org/wiki/Decorator_pattern"&gt;decorator&lt;/a&gt; to add some functionality over it, and you need to do this by configuring your DI container. While many popular DI/IoC containers provide this functionality out of the box, this is not true for .Net Core&amp;rsquo;s DI (&lt;code&gt;IServiceCollection&lt;/code&gt;). Let&amp;rsquo;s consider particular example.&lt;/p&gt;</description></item></channel></rss>