[Bf-blender-cvs] [65e6598e7eb] functions: avoid ambiguous call to make_unique
Jacques Lucke
noreply at git.blender.org
Fri Sep 27 16:59:08 CEST 2019
Commit: 65e6598e7eb492b8bc7fe80306568a564e8f556d
Author: Jacques Lucke
Date: Fri Sep 27 16:59:04 2019 +0200
Branches: functions
https://developer.blender.org/rB65e6598e7eb492b8bc7fe80306568a564e8f556d
avoid ambiguous call to make_unique
===================================================================
M source/blender/functions/core/data_graph_builder.hpp
M source/blender/functions/core/function.hpp
M source/blender/functions/core/function_builder.cpp
M source/blender/functions/core/type.hpp
M source/blender/functions/frontends/data_flow_nodes/function_generation.cpp
M source/blender/functions/frontends/data_flow_nodes/mappings.cpp
M source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
M source/blender/simulations/bparticles/particle_function.cpp
M source/blender/simulations/bparticles/particle_function.hpp
M source/blender/simulations/bparticles/particle_function_builder.cpp
===================================================================
diff --git a/source/blender/functions/core/data_graph_builder.hpp b/source/blender/functions/core/data_graph_builder.hpp
index eda47a55595..c52c48507e6 100644
--- a/source/blender/functions/core/data_graph_builder.hpp
+++ b/source/blender/functions/core/data_graph_builder.hpp
@@ -161,7 +161,7 @@ class DataGraphBuilder {
template<typename T> void add_resource(std::unique_ptr<T> resource, const char *name)
{
if (m_resources.get() == nullptr) {
- m_resources = make_unique<OwnedResources>();
+ m_resources = BLI::make_unique<OwnedResources>();
}
m_resources->add(std::move(resource), name);
}
diff --git a/source/blender/functions/core/function.hpp b/source/blender/functions/core/function.hpp
index d588e6c9b06..0ae6b864cbc 100644
--- a/source/blender/functions/core/function.hpp
+++ b/source/blender/functions/core/function.hpp
@@ -291,7 +291,7 @@ template<typename T> void Function::add_resource(std::unique_ptr<T> resource, co
std::lock_guard<std::mutex> lock(m_modify_mutex);
if (m_resources.get() == nullptr) {
- m_resources = make_unique<OwnedResources>();
+ m_resources = BLI::make_unique<OwnedResources>();
}
m_resources->add(std::move(resource), name);
diff --git a/source/blender/functions/core/function_builder.cpp b/source/blender/functions/core/function_builder.cpp
index 4a614cd6141..ab10a9d2741 100644
--- a/source/blender/functions/core/function_builder.cpp
+++ b/source/blender/functions/core/function_builder.cpp
@@ -57,7 +57,7 @@ std::unique_ptr<Function> FunctionBuilder::build(StringRef function_name)
output_names.append(name.to_string_ref(strings));
}
- return make_unique<Function>(name_ref.to_string_ref(strings),
+ return BLI::make_unique<Function>(name_ref.to_string_ref(strings),
input_names,
m_input_types,
output_names,
diff --git a/source/blender/functions/core/type.hpp b/source/blender/functions/core/type.hpp
index cc11b40c6fd..914fe9ba107 100644
--- a/source/blender/functions/core/type.hpp
+++ b/source/blender/functions/core/type.hpp
@@ -29,7 +29,6 @@
namespace FN {
using BLI::ArrayRef;
-using BLI::make_unique;
using BLI::MutableArrayRef;
using BLI::StringRef;
using BLI::StringRefNull;
diff --git a/source/blender/functions/frontends/data_flow_nodes/function_generation.cpp b/source/blender/functions/frontends/data_flow_nodes/function_generation.cpp
index 6aa3b4caa67..8a45773be2b 100644
--- a/source/blender/functions/frontends/data_flow_nodes/function_generation.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/function_generation.cpp
@@ -34,7 +34,7 @@ static void find_interface_sockets(VirtualNodeTree &vtree,
Optional<std::unique_ptr<Function>> generate_function(bNodeTree *btree)
{
- auto vtree = make_unique<VirtualNodeTree>();
+ auto vtree = BLI::make_unique<VirtualNodeTree>();
vtree->add_all_of_tree(btree);
vtree->freeze_and_index();
diff --git a/source/blender/functions/frontends/data_flow_nodes/mappings.cpp b/source/blender/functions/frontends/data_flow_nodes/mappings.cpp
index 50e74e4cd0d..40b9c53dad2 100644
--- a/source/blender/functions/frontends/data_flow_nodes/mappings.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/mappings.cpp
@@ -8,28 +8,28 @@ namespace DataFlowNodes {
BLI_LAZY_INIT(std::unique_ptr<TypeMappings>, MAPPING_types)
{
- auto mappings = make_unique<TypeMappings>();
+ auto mappings = BLI::make_unique<TypeMappings>();
REGISTER_type_mappings(mappings);
return mappings;
}
BLI_LAZY_INIT(std::unique_ptr<NodeInserters>, MAPPING_node_inserters)
{
- auto inserters = make_unique<NodeInserters>();
+ auto inserters = BLI::make_unique<NodeInserters>();
REGISTER_node_inserters(inserters);
return inserters;
}
BLI_LAZY_INIT(std::unique_ptr<SocketLoaders>, MAPPING_socket_loaders)
{
- auto loaders = make_unique<SocketLoaders>();
+ auto loaders = BLI::make_unique<SocketLoaders>();
REGISTER_socket_loaders(loaders);
return loaders;
}
BLI_LAZY_INIT(std::unique_ptr<LinkInserters>, MAPPING_link_inserters)
{
- auto inserters = make_unique<LinkInserters>();
+ auto inserters = BLI::make_unique<LinkInserters>();
REGISTER_conversion_inserters(inserters);
return inserters;
}
diff --git a/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp b/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
index 36b51cb892b..86b6c8a48ef 100644
--- a/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
@@ -168,10 +168,11 @@ void ConstantInputsHandler::insert(VTreeDataGraphBuilder &builder,
std::unique_ptr<Function> fn = fn_builder.build("Unlinked Inputs");
- std::unique_ptr<TupleMeta> inputs_meta = make_unique<TupleMeta>(fn->output_types());
+ std::unique_ptr<TupleMeta> inputs_meta = BLI::make_unique<TupleMeta>(fn->output_types());
- auto inputs_tuple_data_init = make_unique<Array<char>>(inputs_meta->size_of_data_and_init());
- std::unique_ptr<Tuple> inputs_tuple = make_unique<Tuple>(
+ auto inputs_tuple_data_init = BLI::make_unique<Array<char>>(
+ inputs_meta->size_of_data_and_init());
+ std::unique_ptr<Tuple> inputs_tuple = BLI::make_unique<Tuple>(
*inputs_meta, (void *)inputs_tuple_data_init->begin());
ConstantOutput &tuple_call_body = *fn->add_body<ConstantOutput>();
diff --git a/source/blender/simulations/bparticles/particle_function.cpp b/source/blender/simulations/bparticles/particle_function.cpp
index c0520e329a7..d7df9039887 100644
--- a/source/blender/simulations/bparticles/particle_function.cpp
+++ b/source/blender/simulations/bparticles/particle_function.cpp
@@ -91,7 +91,7 @@ std::unique_ptr<ParticleFunctionResult> ParticleFunction::compute(ArrayRef<uint>
{
uint parameter_amount = m_parameter_depends_on_particle.size();
- auto result = make_unique<ParticleFunctionResult>();
+ auto result = BLI::make_unique<ParticleFunctionResult>();
result->m_buffers.append_n_times(nullptr, parameter_amount);
result->m_only_first.append_n_times(false, parameter_amount);
result->m_strides.append_n_times(0, parameter_amount);
diff --git a/source/blender/simulations/bparticles/particle_function.hpp b/source/blender/simulations/bparticles/particle_function.hpp
index 2727910f896..67529c488de 100644
--- a/source/blender/simulations/bparticles/particle_function.hpp
+++ b/source/blender/simulations/bparticles/particle_function.hpp
@@ -10,7 +10,6 @@
namespace BParticles {
using BLI::ArrayRef;
-using BLI::make_unique;
using BLI::Optional;
using BLI::TemporaryArray;
using BLI::TemporaryVector;
diff --git a/source/blender/simulations/bparticles/particle_function_builder.cpp b/source/blender/simulations/bparticles/particle_function_builder.cpp
index cf7d7d3aa60..e234deca94b 100644
--- a/source/blender/simulations/bparticles/particle_function_builder.cpp
+++ b/source/blender/simulations/bparticles/particle_function_builder.cpp
@@ -245,10 +245,10 @@ static Optional<std::unique_ptr<ParticleFunction>> create_particle_function_from
std::unique_ptr<Function> fn_with_deps = create_function__with_deps(
data_graph, name, sockets_with_deps, dependencies, input_providers);
- return make_unique<ParticleFunction>(std::move(fn_without_deps),
- std::move(fn_with_deps),
- input_providers,
- depends_on_particle_flags);
+ return BLI::make_unique<ParticleFunction>(std::move(fn_without_deps),
+ std::move(fn_with_deps),
+ input_providers,
+ depends_on_particle_flags);
}
Optional<std::unique_ptr<ParticleFunction>> create_particle_function(VirtualNode *vnode,
More information about the Bf-blender-cvs
mailing list