我有一个使用Polymer.dart的dart应用程序,我用boot.js替换了dart.js文件(在我的index.html中),现在我想部署这个应用程序以便有一个有效的javascript文件.
但是,当我启动build.dart时,我有:
Total time spent on web/index.html -- 504 ms
Total time -- 555 ms
Run Code Online (Sandbox Code Playgroud)
但没有创建,没有更多的"out"文件夹.当我进行Pub Deploy时,它会创建一个"部署"文件夹,但该版本无效(因为我认为build.dart不能正常工作).
你知道吗?
我用了很多C ++ 20的新功能:std::span<T>。这对于编写通常带有指针和大小的函数很有用。
#include <array>
#include <span>
#include <vector>
std::vector<uint8_t> v1 {1,2,3,4,5};
std::array<uint8_t, 4> v2 {1,2,3,4};
uint8_t v3[3] = {1,2,3};
void f(std::span<uint8_t> arr){
...
}
/// call f with v1 or v2 or v3
f(v1);
f(v2);
f(v3);
Run Code Online (Sandbox Code Playgroud)
现在,我想要一个将跨度作为参数的函数。
std::vector<std::array<uint8_t,10>> v1;
v1.push_back({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
v1.push_back({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
v1.push_back({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
void f(std::span<std::span<uint8_t, 10>> arr){
...
}
f(v1);
Run Code Online (Sandbox Code Playgroud)
不幸的是,这根本没有编译。这将是一种处理二维数组的方法。 …