Discussion:
[boost] [gil::io] Dependent Name issue with VS2015 Update3
Christian Henning via Boost
2017-07-01 19:05:05 UTC
Permalink
Hi all,

using the new gil::io on gil's develop branch I get a compilation error
with Visual Studio 2015 Update 3.

When trying to read a tiff image:

#include <string>

#include <boost\gil\gil_all.hpp>
#include <boost\gil\extension\io\tiff_all.hpp>

using namespace std;
using namespace boost::gil;

int main()
{

rgba8_image_t img;
read_image( string(), img, tiff_tag() );

return 0;
}

I get an error:

error C2951: template declarations are only permitted at global, namespace,
or class scope


The problem seems to be with

https://github.com/boostorg/gil/blob/develop/include/boost/gil/extension/io/formats/tiff/device.hpp#L143

Can someone please tell me if my issue is a compiler issue or simply a
syntax error.

Thanks,
Christian

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Andrey Semashev via Boost
2017-07-01 19:51:52 UTC
Permalink
Post by Christian Henning via Boost
Hi all,
using the new gil::io on gil's develop branch I get a compilation error
with Visual Studio 2015 Update 3.
#include <string>
#include <boost\gil\gil_all.hpp>
#include <boost\gil\extension\io\tiff_all.hpp>
using namespace std;
using namespace boost::gil;
int main()
{
rgba8_image_t img;
read_image( string(), img, tiff_tag() );
return 0;
}
error C2951: template declarations are only permitted at global, namespace,
or class scope
The problem seems to be with
https://github.com/boostorg/gil/blob/develop/include/boost/gil/extension/io/formats/tiff/device.hpp#L143
Can someone please tell me if my issue is a compiler issue or simply a
syntax error.
Looks like a compiler bug to me. You can try replacing
`get_property_f::operator()` with a regular named function. Same with
`set_property`.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Christian Henning via Boost
2017-07-01 22:42:38 UTC
Permalink
Hi Andrey,
Post by Andrey Semashev via Boost
Post by Christian Henning via Boost
Hi all,
using the new gil::io on gil's develop branch I get a compilation error
with Visual Studio 2015 Update 3.
#include <string>
#include <boost\gil\gil_all.hpp>
#include <boost\gil\extension\io\tiff_all.hpp>
using namespace std;
using namespace boost::gil;
int main()
{
rgba8_image_t img;
read_image( string(), img, tiff_tag() );
return 0;
}
error C2951: template declarations are only permitted at global, namespace,
or class scope
The problem seems to be with
https://github.com/boostorg/gil/blob/develop/include/boost/
gil/extension/io/formats/tiff/device.hpp#L143
Can someone please tell me if my issue is a compiler issue or simply a
syntax error.
Looks like a compiler bug to me. You can try replacing
`get_property_f::operator()` with a regular named function. Same with
`set_property`.
Thanks Andrey. Stefan Seefeld had the same inclination. I'll try to rename
operator() and see if that fixes the issue.

Regards,
Christian

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Stefan Seefeld via Boost
2017-07-01 23:08:05 UTC
Permalink
Post by Christian Henning via Boost
Hi Andrey,
Post by Andrey Semashev via Boost
Looks like a compiler bug to me. You can try replacing
`get_property_f::operator()` with a regular named function. Same with
`set_property`.
Thanks Andrey. Stefan Seefeld had the same inclination. I'll try to rename
operator() and see if that fixes the issue.
Note that the problem isn't the (name of the) operator(). It's the fact
that it is a function / operator template, within a class template,
which requires the "template" keyword to disambiguate the syntax (gotta
love C++...). I believe the suggestion is to fuse the two into one (i.e.
make a single function template with two template parameters, rather
than a function template within a class template, or something like that...

An entirely different approach would be to simply punt and skip that
particular set of tiff tests with the buggy compiler. (That would
require the tests to be separated into separate executables, though, so
the others would be able to compile and run.)

Stefan
--
...ich hab' noch einen Koffer in Berlin...


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...