Skip to content

Instantly share code, notes, and snippets.

@psfrolov
psfrolov / int-msi.targets
Created April 25, 2015 07:58
Creating multi-language MSI package with MSBuild
<Target Name="AfterBuild">
<!-- Set inputs & outputs for CreateLanguageTransforms. -->
<ItemGroup>
<MsiForTransform
Include="$(OutputDir)\%(CultureGroup.OutputFolder)$(OutputFullName)"
Exclude="$(OutputDir)\en-US_\$(OutputFullName)"
/>
<Transform
Include="$(OutputDir)\%(CultureGroup.OutputFolder)%(CultureGroup.Identity).mst"
Exclude="$(OutputDir)\en-US_\%(CultureGroup.Identity).mst"
#include <cassert>
#include <memory> // std::addressof
template<typename ResourceTag, typename ResourceType> class Resource {
public:
Resource() noexcept = default;
explicit Resource(ResourceType resource) noexcept : resource_{ resource } {}
Resource(const Resource&) = delete;
Resource& operator=(const Resource&) = delete;
@psfrolov
psfrolov / class-members-expl-spec.cc
Last active August 29, 2019 22:29
Providing Explicit Specialisations for Non-Template Members of Class Template
// Tested with Clang 3.4, GCC 4.8.2.
#include <iostream>
#include <string>
template<typename T> class Foo {
public:
std::string Method();
static std::string StaticMethod();
@psfrolov
psfrolov / boost_signals2_plus_fusion.cc
Last active August 22, 2022 05:08
Observable mixins using Boost, the standard library, or a mixture of both.
#include <iostream>
#include <utility>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
#include <boost/utility/in_place_factory.hpp>