Skip to content

Commit

Permalink
Remove variant header
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Aug 23, 2024
1 parent 670833a commit 85e540b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 34 deletions.
1 change: 0 additions & 1 deletion source/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_sources(tactile-base
"inc/tactile/base/container/string.hpp"
"inc/tactile/base/container/string_map.hpp"
"inc/tactile/base/container/tree_map.hpp"
"inc/tactile/base/container/variant.hpp"
"inc/tactile/base/container/vector.hpp"
"inc/tactile/base/document/component_view.hpp"
"inc/tactile/base/document/document.hpp"
Expand Down
14 changes: 0 additions & 14 deletions source/base/inc/tactile/base/container/variant.hpp

This file was deleted.

29 changes: 14 additions & 15 deletions source/base/inc/tactile/base/meta/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
#include <stdexcept> // logic_error
#include <type_traits> // decay_t
#include <utility> // move
#include <variant> // visit
#include <variant> // variant, visit

#include "tactile/base/container/path.hpp"
#include "tactile/base/container/string.hpp"
#include "tactile/base/container/variant.hpp"
#include "tactile/base/id.hpp"
#include "tactile/base/meta/attribute_type.hpp"
#include "tactile/base/meta/color.hpp"
Expand Down Expand Up @@ -71,19 +70,19 @@ class Attribute final
using objref_type = ObjectRef;

// Remember to update the type indices if the type order changes.
using variant_type = Variant<string_type,
int_type,
int2_type,
int3_type,
int4_type,
float_type,
float2_type,
float3_type,
float4_type,
bool,
color_type,
path_type,
objref_type>;
using variant_type = std::variant<string_type,
int_type,
int2_type,
int3_type,
int4_type,
float_type,
float2_type,
float3_type,
float4_type,
bool,
color_type,
path_type,
objref_type>;

/**
* Creates an empty string attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

#pragma once

#include <variant> // variant

#include <gmock/gmock.h>

#include "tactile/base/container/maybe.hpp"
#include "tactile/base/container/smart_ptr.hpp"
#include "tactile/base/container/variant.hpp"
#include "tactile/base/container/vector.hpp"
#include "tactile/base/document/document_visitor.hpp"
#include "tactile/base/document/layer_view.hpp"
Expand Down Expand Up @@ -44,7 +45,7 @@ class ObjectViewMock : public IObjectView
{
public:
explicit ObjectViewMock(ir::Object object,
Variant<const ILayerView*, const ITileView*> parent = {});
std::variant<const ILayerView*, const ITileView*> parent = {});

MOCK_METHOD((std::expected<void, std::error_code>),
accept,
Expand Down Expand Up @@ -77,7 +78,7 @@ class ObjectViewMock : public IObjectView

private:
ir::Object mObject {};
Variant<const ILayerView*, const ITileView*> mParent {};
std::variant<const ILayerView*, const ITileView*> mParent {};
testing::NiceMock<MetaViewMock> mMeta {};
};

Expand Down
2 changes: 1 addition & 1 deletion source/test_util/src/document_view_mocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MetaViewMock::MetaViewMock(ir::Metadata meta) :
}

ObjectViewMock::ObjectViewMock(ir::Object object,
Variant<const ILayerView*, const ITileView*> parent) :
std::variant<const ILayerView*, const ITileView*> parent) :
mObject {std::move(object)},
mParent {parent},
mMeta {mObject.meta}
Expand Down

0 comments on commit 85e540b

Please sign in to comment.