Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

multi_array doesn't compile

未关闭 适合新手
#38 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
cpp
领域
backend

调研方向

使用报告中的 MSVC 示例复现该问题,然后检查指定行中的 boost/multi_array/storage_order.hpp 和 boost/multi_array/multi_array_ref.hpp。检查涉及已弃用 assign 调用和 extents 声明的构造函数诊断;完成的标准是该示例能够在没有这些错误或警告的情况下编译。

由索引模型根据 Issue 内容生成。

描述

There are a lot of errors with simple multi_array instantiation:

  1. declaration of 'extents' hides global declaration
  2. deprecated assign method is used instead of fill in boost::array used for extents and storage_order in multi_array constructor. Problem with storage_order constructor and multi_array constructor itself.

Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34810 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

#include <boost/multi_array.hpp>

GlobalFixture::GlobalFixture() {
boost::multi_array<double, 4> ma;
}

1>------ Build started: Project: mts_test_utility, Configuration: Debug x64 ------
1>GlobalFixture.cpp
1>C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(615,45): warning C4459: declaration of 'extents' hides global declaration
1>(compiling source file '/GlobalFixture.cpp')
1> C:\boost_1_88_0\boost\multi_array\base.hpp(69,33):
1> see declaration of 'boost::anonymous-namespace'::extents' 1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(615,45): 1> the template instantiation context (the oldest one first) is 1> C:\MTS\mts_test_utility\GlobalFixture.cpp(16,32): 1> see reference to class template instantiation 'boost::multi_array<double,4,std::allocator<double>>' being compiled 1> C:\boost_1_88_0\boost\multi_array.hpp(122,10): 1> see reference to class template instantiation 'boost::multi_array_ref<T,4>' being compiled 1> with 1> [ 1> T=double 1> ] 1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(612,3): 1> while compiling class template member function 'boost::multi_array_ref<T,4>::multi_array_ref(T *,const boost::general_storage_order<4> &,const __int64 *,const unsigned __int64 *)' 1> with 1> [ 1> T=double 1> ] 1> C:\boost_1_88_0\boost\multi_array.hpp(153,15): 1> see the first reference to 'boost::multi_array_ref<T,4>::multi_array_ref' in 'boost::multi_array<double,4,std::allocator<double>>::multi_array' 1> with 1> [ 1> T=double 1> ] 1> C:\MTS\mts_test_utility\GlobalFixture.cpp(16,32): 1> see the first reference to 'boost::multi_array<double,4,std::allocator<double>>::multi_array' in 'GlobalFixture::GlobalFixture' 1>C:\boost_1_88_0\boost\multi_array\storage_order.hpp(51,18): error C4996: 'boost::array<bool,4>::assign': please use fill instead 1>(compiling source file '/GlobalFixture.cpp') 1> C:\boost_1_88_0\boost\multi_array\storage_order.hpp(51,18): 1> the template instantiation context (the oldest one first) is 1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(413,10): 1> see reference to class template instantiation 'boost::const_multi_array_ref<T,4,T *>' being compiled 1> with 1> [ 1> T=double 1> ] 1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(350,22): 1> see reference to class template instantiation 'boost::general_storage_order<4>' being compiled 1> C:\boost_1_88_0\boost\multi_array\storage_order.hpp(47,5): 1> while compiling class template member function 'boost::general_storage_order<4>::general_storage_order(const boost::c_storage_order &)' 1> C:\boost_1_88_0\boost\multi_array.hpp(153,15): 1> see the first reference to 'boost::general_storage_order<4>::general_storage_order' in 'boost::multi_array<double,4,std::allocator<double>>::multi_array' 1> C:\MTS\mts_test_utility\GlobalFixture.cpp(16,32): 1> see the first reference to 'boost::multi_array<double,4,std::allocator<double>>::multi_array' in 'GlobalFixture::GlobalFixture' 1>C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(328,42): warning C4459: declaration of 'extents' hides global declaration 1>(compiling source file '/GlobalFixture.cpp') 1> C:\boost_1_88_0\boost\multi_array\base.hpp(69,33): 1> see declaration of 'boost::anonymous-namespace'::extents'
1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(328,42):
1> the template instantiation context (the oldest one first) is
1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(324,3):
1> while compiling class template member function 'boost::const_multi_array_ref<T,4,T *>::const_multi_array_ref(TPtr,const boost::general_storage_order<4> &,const __int64 *,const unsigned __int64 *)'
1> with
1> [
1> T=double,
1> TPtr=double *
1> ]
1> C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(616,15):
1> see the first reference to 'boost::const_multi_array_ref<T,4,T *>::const_multi_array_ref' in 'boost::multi_array_ref<T,4>::multi_array_ref'
1> with
1> [
1> T=double
1> ]
1> C:\boost_1_88_0\boost\multi_array.hpp(153,15):
1> see the first reference to 'boost::multi_array_ref<T,4>::multi_array_ref' in 'boost::multi_array<double,4,std::allocator>::multi_array'
1> with
1> [
1> T=double
1> ]
1> C:\MTS\mts_test_utility\GlobalFixture.cpp(16,32):
1> see the first reference to 'boost::multi_array<double,4,std::allocator>::multi_array' in 'GlobalFixture::GlobalFixture'
1>C:\boost_1_88_0\boost\multi_array\multi_array_ref.hpp(343,18): error C4996: 'boost::array<__int64,4>::assign': please use fill instead
1>(compiling source file '/GlobalFixture.cpp')
1>Done building project "mts_test_utility.vcxproj" -- FAILED.

主要语言
C++
星标
32
派生
39
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

boostorg/multi_array 的其他 Issue

查看 boostorg/multi_array 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。