Skip to content

Commit

Permalink
[3rdparty] Update pybind11, set a proper commit for libcoap, add a ty…
Browse files Browse the repository at this point in the history
…pe_if helper
  • Loading branch information
jcelerier committed Aug 7, 2024
1 parent 0fb5beb commit 062cdfa
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/pybind11
Submodule pybind11 updated 209 files
2 changes: 1 addition & 1 deletion cmake/deps/coap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(NOT TARGET libcoap::coap-3)
FetchContent_Declare(
libcoap
GIT_REPOSITORY "https://github.com/obgm/libcoap"
GIT_TAG develop
GIT_TAG main
GIT_PROGRESS true
)

Expand Down
1 change: 1 addition & 0 deletions src/ossia/dataflow/execution_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct OSSIA_EXPORT execution_state : public Nano::Observer
{
return m_devices_exec;
}

ossia::net::node_base* find_node(std::string_view name) const noexcept
{
for(auto dev : m_devices_exec)
Expand Down
56 changes: 56 additions & 0 deletions src/ossia/detail/type_if.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#pragma once
#include <utility>

namespace ossia
{

template <typename T, bool Predicate>
struct type_if;
template <typename T>
struct type_if<T, false>
{
type_if() = default;
type_if(const type_if&) = default;
type_if(type_if&&) = default;
type_if& operator=(const type_if&) = default;
type_if& operator=(type_if&&) = default;

template <typename U>
type_if(U&&)
{
}
template <typename U>
T& operator=(U&& u) noexcept
{
return *this;
}
};

template <typename T>
struct type_if<T, true>
{
[[no_unique_address]] T value;

type_if() = default;
type_if(const type_if&) = default;
type_if(type_if&&) = default;
type_if& operator=(const type_if&) = default;
type_if& operator=(type_if&&) = default;

template <typename U>
type_if(U&& other)
: value{std::forward<U>(other)}
{
}

operator const T&() const noexcept { return value; }
operator T&() noexcept { return value; }
operator T&&() && noexcept { return std::move(value); }

template <typename U>
T& operator=(U&& u) noexcept
{
return value = std::forward<U>(u);
}
};
}

0 comments on commit 062cdfa

Please sign in to comment.