Skip to content

Does not compile: no declaration matches ArrayToTuple #14

@ulidtko

Description

@ulidtko

Hi!

I've tried building this, and got a compile error (GCC 8.2.1):

[  3%] Building CXX object source/reshaper/source/private/CMakeFiles/reshaper-impl.dir/ImageView.cpp.o
In file included from Depixelization/source/reshaper/source/private/ImageView.cpp:1:
Depixelization/source/reshaper/include/private/ImageView.h:220:6: error: no declaration matches ‘auto dpa::image::internal::ImageView<Channels, BitDepth>::ArrayToTuple(const std::array<BitDepth, channel_count_v<Channels> >&) const’
 auto ImageView<Channels, BitDepth>::ArrayToTuple(const std::array<BitDepth, channel_count_v<Channels>>& array) const noexcept
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/ImageView.h:46:10: note: candidate is: ‘template<template<class> class Channels, class BitDepth> template<class Indices> auto dpa::image::internal::ImageView<Channels, BitDepth>::ArrayToTuple(const std::array<BitDepth, channel_count_v<Channels> >&) const’
     auto ArrayToTuple(const std::array<BitDepth, channel_count_v<Channels>> & array) const noexcept;
          ^~~~~~~~~~~~
source/reshaper/include/private/ImageView.h:21:7: note: ‘class dpa::image::internal::ImageView<Channels, BitDepth>’ defined here
 class ImageView final
       ^~~~~~~~~

This error is pretty challenging to digest, even to people calling themselves C++ programmers.

If that matters: I use cmake 3.15.5. Oh, indeed, here's also an output from [relatively old] Clang 7.0.1:

In file included from Depixelization/source/reshaper/source/private/ImageView.cpp:1:
In file included from Depixelization/source/reshaper/include/private/ImageView.h:3:
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:70:22: error: template template argument has different template parameters than its
      corresponding template template parameter
struct channel_count<Y>
                     ^
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:44:1: note: too many template parameters in template template argument
template<typename BitDepth, typename = EnableIfSTBBitDepth<BitDepth>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:59:10: note: previous template template parameter is here
template<template<typename> class Channels>
         ^~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:76:22: error: template template argument has different template parameters than its
      corresponding template template parameter
struct channel_count<YA>
                     ^
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:47:1: note: too many template parameters in template template argument
template<typename BitDepth, typename = EnableIfSTBBitDepth<BitDepth>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:59:10: note: previous template template parameter is here
template<template<typename> class Channels>
         ^~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:82:22: error: template template argument has different template parameters than its
      corresponding template template parameter
struct channel_count<RGB>
                     ^
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:50:1: note: too many template parameters in template template argument
template<typename BitDepth, typename = EnableIfSTBBitDepth<BitDepth>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:59:10: note: previous template template parameter is here
template<template<typename> class Channels>
         ^~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:88:22: error: template template argument has different template parameters than its
      corresponding template template parameter
struct channel_count<YCbCr>
                     ^
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:53:1: note: too many template parameters in template template argument
template<typename BitDepth, typename = EnableIfSTBBitDepth<BitDepth>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:59:10: note: previous template template parameter is here
template<template<typename> class Channels>
         ^~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:94:22: error: template template argument has different template parameters than its
      corresponding template template parameter
struct channel_count<RGBA>
                     ^
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:56:1: note: too many template parameters in template template argument
template<typename BitDepth, typename = EnableIfSTBBitDepth<BitDepth>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Depixelization/source/reshaper/include/private/../reshaper/Pixel.h:59:10: note: previous template template parameter is here
template<template<typename> class Channels>
         ^~~~~~~~~~~~~~~~~~
5 errors generated.

Can you fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    build issueIssues related to the build system or compilation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions