diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 685671c34cd..fd966a7afc1 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -50,8 +50,8 @@ typedef device_delegate write_line_delegate; namespace emu::detail { -template struct rw_delegate_type > > > { using type = read_line_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write_line_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read_line_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write_line_delegate; using device_class = rw_device_class_t >; }; } // namespace emu::detail @@ -70,6 +70,10 @@ public: virtual void validity_check(validity_checker &valid) const = 0; protected: + // This is in C++17 but not C++14 + template struct void_wrapper { using type = void; }; + template using void_t = typename void_wrapper::type; + // Intermediate is larger of input and output, mask is forced to unsigned template struct intermediate; template struct intermediate= sizeof(U)> > { using type = T; }; @@ -224,19 +228,19 @@ protected: // Detecting candidates for read delegates template struct is_read_method { static constexpr bool value = false; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; - template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; + template struct is_read_method > > > { static constexpr bool value = true; }; // Invoking read callbacks template static std::enable_if_t::value, mask_t, Result> > invoke_read(T const &cb, offs_t offset, std::make_unsigned_t mem_mask) { return std::make_unsigned_t >(cb(offset, mem_mask)); } @@ -274,26 +278,26 @@ protected: template struct is_write_form1 { static constexpr bool value = false; }; template struct is_write_form2 { static constexpr bool value = false; }; template struct is_write_form3 { static constexpr bool value = false; }; - template struct is_write_form1)> > > { static constexpr bool value = true; }; - template struct is_write_form2 > > { static constexpr bool value = true; }; - template struct is_write_form3 > > { static constexpr bool value = true; }; + template struct is_write_form1)> > > { static constexpr bool value = true; }; + template struct is_write_form2 > > { static constexpr bool value = true; }; + template struct is_write_form3 > > { static constexpr bool value = true; }; template struct is_write { static constexpr bool value = is_write_form1::value || is_write_form2::value || is_write_form3::value; }; // Detecting candidates for write delegates template struct is_write_method { static constexpr bool value = false; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; - template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; + template struct is_write_method > > > { static constexpr bool value = true; }; // Invoking write callbacks template static std::enable_if_t::value> invoke_write(T const &cb, offs_t &offset, Input data, std::make_unsigned_t mem_mask) { return cb(offset, data, mem_mask); } diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 1270d1e264a..e9a2fe0029a 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -156,6 +156,10 @@ using write64smo_delegate = device_delegate; namespace emu::detail { +// TODO: replace with std::void_t when we move to C++17 +template struct void_wrapper { using type = void; }; +template using void_t = typename void_wrapper::type; + template struct rw_device_class { }; template @@ -168,54 +172,54 @@ struct rw_device_class using rw_device_class_t = typename rw_device_class::type; template struct rw_delegate_type; -template struct rw_delegate_type > > > { using type = read8_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read8m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read8s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read8sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read8mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read8smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read16smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read32smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = read64smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64m_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64s_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64sm_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64mo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write8smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write16smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write32smo_delegate; using device_class = rw_device_class_t >; }; -template struct rw_delegate_type > > > { using type = write64smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read8smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read16smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read32smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = read64smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64m_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64s_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64sm_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64mo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write8smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write16smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write32smo_delegate; using device_class = rw_device_class_t >; }; +template struct rw_delegate_type > > > { using type = write64smo_delegate; using device_class = rw_device_class_t >; }; template using rw_delegate_type_t = typename rw_delegate_type::type; template using rw_delegate_device_class_t = typename rw_delegate_type::device_class;