小编Jam*_*sNZ的帖子

在UWP应用程序中使用WPF dll

我正在写一个UWP应用程序,由于某种原因我无法参考PresentationFramework.dll.它包含一些我想要使用的WPF控件(具体来说,System.Windows.Controls.DataGrid它们在参考管理器中的Universal Windows >> Extensions下不可用.为什么会这样,我该如何解决?

c# wpf xaml reference uwp

4
推荐指数
1
解决办法
5156
查看次数

奇数std :: vector :: emplace()编译错误

我在使用std::vector::emplace()和时遇到了一个奇怪的编译器错误std::vector::emplace_back():

#include <vector>

struct Foo {
    int bar;

    Foo(int _bar) : bar(_bar) { }
};

int main() {
    // Declaration 1
    std::vector<Foo> vec(10);

    // Declaration 2
    // std::vector<Foo> vec{};

    vec.emplace_back(1);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我编译它时,我收到以下错误:

In file included from /usr/include/c++/6/vector:62:0,
                 from prog.cpp:2:
/usr/include/c++/6/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = Foo; _Args = {}]’:
/usr/include/c++/6/bits/stl_uninitialized.h:519:18:   required from ‘static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Foo*; _Size = long unsigned int; bool _TrivialValueType …
Run Code Online (Sandbox Code Playgroud)

c++ compiler-errors vector c++11 emplace

2
推荐指数
1
解决办法
397
查看次数

标签 统计

c# ×1

c++ ×1

c++11 ×1

compiler-errors ×1

emplace ×1

reference ×1

uwp ×1

vector ×1

wpf ×1

xaml ×1