CMake能够为XCode <= 7和iOS项目配置自动代码签名,目标属性设置如
set_target_properties(app PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "PROPER IDENTIFIER")
Run Code Online (Sandbox Code Playgroud)
XCode 8改变了签名过程.现在需要选中项目设置"常规选项卡 - >签名"中的"自动管理签名"选项.如果我为cmake生成的项目手动检查此选项,则签名很有效.但是我没有找到默认情况下从cmake项目启用此选项的方法.这可以用于cmake(> = 3.7.0)吗?
设置-std = c ++ 17时,以下代码在g ++ 8.3和7.4中可以正常编译:
#include <any>
#include <tuple>
#include <vector>
int main()
{
std::vector<std::tuple<std::any>> f2;
f2.emplace_back(42);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
VS2017也很好用。
但是在g ++ 9.1中,我看到此错误:
In file included from /usr/include/c++/9/bits/move.h:55,
from /usr/include/c++/9/bits/nested_exception.h:40,
from /usr/include/c++/9/exception:144,
from /usr/include/c++/9/new:40,
from /usr/include/c++/9/any:37,
from a.cpp:1:
/usr/include/c++/9/type_traits: In instantiation of ‘struct std::__and_<std::is_constructible<std::tuple<std::any>, std::tuple<std::any>&&>, std::__is_nt_constructible_impl<std::tuple<std::any>, std::tuple<std::any>&&> >’:
/usr/include/c++/9/type_traits:974:12: required from ‘struct std::is_nothrow_constructible<std::tuple<std::any>, std::tuple<std::any>&&>’
/usr/include/c++/9/type_traits:1005:12: required from ‘struct std::__is_nothrow_move_constructible_impl<std::tuple<std::any>, true>’
/usr/include/c++/9/type_traits:1011:12: required from ‘struct std::is_nothrow_move_constructible<std::tuple<std::any> >’
/usr/include/c++/9/any:95:67: required by substitution of ‘template<class _Tp, class _Safe, bool _Fits> …Run Code Online (Sandbox Code Playgroud) 是否可以在编译时将 base64 编码数据解码为二进制数据?
我想到了这样的事情:
constexpr auto decoded = decodeBase64<"SGVsbG8=">();
或者
constexpr auto decoded = decodeBase64("SGVsbG8=");
我对生成的decoded.
以下代码(从大型项目中最小化)在使用XCode 7.3.1,针对iOS的Boost 1.61构建时导致EXC_BAD_INSTRUCTION崩溃:
main.mm:
#include "stdio.h"
#include "boost/lockfree/queue.hpp"
int main(int argc, char * argv[]) {
printf("Test1 in\n");
boost::lockfree::queue<int*> q(100);
printf("Test1 out\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
stacktrace似乎告诉我,问题来自c ++原子操作:
#0 0x0000000100047a78 in std::__1::__atomic_base<boost::lockfree::detail::tagged_ptr<boost::lockfree::detail::freelist_stack<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node, std::__1::allocator<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node> >::freelist_node>, false>::store(boost::lockfree::detail::tagged_ptr<boost::lockfree::detail::freelist_stack<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node, std::__1::allocator<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node> >::freelist_node>, std::__1::memory_order) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic:842
#1 0x0000000100047a74 in boost::lockfree::detail::freelist_stack<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node, std::__1::allocator<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node> >::deallocate_impl_unsafe(boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node*) at /Users/deinzer/src/pipeline.ios/boost/boost/lockfree/detail/freelist.hpp:251
#2 0x00000001000479e8 in boost::lockfree::detail::freelist_stack<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node, std::__1::allocator<boost::lockfree::queue<int*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node> >::freelist_stack<std::__1::allocator<boost::lockfree::queue<int*, …Run Code Online (Sandbox Code Playgroud)