腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
从
std
::
vector
到
adept
::
avector
c++
、
rcpp
默认情况下,它们以Rcpp:NumericVector的形式出现,这很容易转换为
std
::
vector
或doubles数组,例如double* inx_d = inx_
std
.data(); 然而,我在把它传递给
avector
a时遇到了问题。
avector
a = inx_d不工作。我创建了一个for循环,一切都正常,但肯定有更好的方
浏览 9
提问于2018-07-29
得票数 1
回答已采纳
2
回答
C++我想避免指针,而是使用STL和引用来维护一个小的数据缓存
c++
、
reference
、
stl
#include <iostream>#include <string> {
std
::
vector
<A>
avector
;{ A& ret = x.<em
浏览 0
提问于2018-11-16
得票数 0
回答已采纳
1
回答
在类声明之外实现的enable_if方法专门化
c++
、
templates
#include <
vector
> classA{ typedef
std
::
vector
<t>
Avector
; template <class T=t,
浏览 2
提问于2017-06-09
得票数 2
3
回答
如何理解"
vector
<int>
avector
( arr,arr+ sizeof(arr) / sizeof(arr[0]) )"?
c++
、
arrays
、
vector
、
stl
在下面的代码中,在main()中 for (int passnum =
avector
.size()-1; passnum
浏览 1
提问于2019-08-13
得票数 2
2
回答
带有初始化和不初始化的向量分割错误
c++
、
stdvector
我使用的代码如下#include <iostream> {
std
::cout << "
Vector
size: " << <
浏览 0
提问于2014-08-17
得票数 0
回答已采纳
5
回答
在c++中访问向量内的数组
c++
、
arrays
、
vector
std
::
vector
<int>
aVector
;unsigned anArraySize = sizeof(anArray) / sizeof(int); }它基本上是将一个大小为2(0,1)的数组插入
到
称为ijVector的向量中。例如,类似于 for (int i = 0; i -->
浏览 6
提问于2015-10-01
得票数 1
回答已采纳
3
回答
find_if无法检测到向量是空的
c++
、
vector
我想使用find_if
从
#include <algorithm>,但问题是它不能识别的向量是空的或不。假设下面的片段myVector
aVector
;{ equal(c
浏览 2
提问于2013-06-17
得票数 0
回答已采纳
1
回答
在父类类型向量中保存时调用派生类函数
c++
我有两个类A和B以及一个
AVector
类来存储A类的对象和
从
A类派生的类。::string sayHello() { return "Hello"; } using
std
::
vector
<A>::at; using
std
::
vector
&
浏览 11
提问于2020-12-19
得票数 0
2
回答
如何连接多个
std
::载体?
c++
、
vector
、
stdvector
我有两门课是这样的:public:private:}; public:
std</em
浏览 1
提问于2015-02-16
得票数 3
回答已采纳
1
回答
流迭代器.字节流
c++
、
c++11
例如:noskipws(afile);
std
::
vector
<uint_8> vOfBytes = {
std
::istream_iterator例如:
std
::wstring awstring = L"abc";
std
::
vector
avector</em
浏览 2
提问于2015-08-25
得票数 1
回答已采纳
1
回答
是否有任何方法将指针转发到类而不引用其模板类型?
c++
、
pointers
、
forward-declaration
在foo.h:class A {};我要的是把这个放在酒吧里。#include <
vector
>
AVector
*myVector;}; 我想将
浏览 2
提问于2017-03-27
得票数 0
4
回答
将向量指针作为输入传递给方法
c++
void method1(
std
::
vector
<String> * myVector ) myVector = new
std
::
vector
<String>(); myVector->push_things;所以,我会像这样
从
topMethod()调用method1。topMethod()
std
::
vector
<String>
浏览 0
提问于2011-08-06
得票数 0
回答已采纳
1
回答
如何将C++11程序链接到熟练库
c++
、
c++11
、
automatic-differentiation
, const char** argv) using namespace
adept
; Stack stack; x << 1.0stack.new_recording(); J.set_gradient(1.0);
std
但是,如果我试图使用C++11标准编译,使用g++ -Wall -O2 -
std
=c+
浏览 9
提问于2022-08-11
得票数 0
回答已采纳
2
回答
错误写入Excel文件- C++
c++
、
excel
、
memory
、
fstream
如果您看到代码,我想会更清楚:#include<array>#include<fstream>
std
::
vector
<double>
aVector
; {
aVector</em
浏览 9
提问于2019-10-29
得票数 1
回答已采纳
1
回答
如何解决没有头的共享基类的循环类依赖关系?
c++
、
c++11
、
visual-studio-2012
、
circular-dependency
#include <iostream>public:}; // compiler error:// class C : public A;
std
::
vecto
浏览 2
提问于2015-05-05
得票数 7
回答已采纳
4
回答
重载类下标操作符以访问成员
std
::
vector
对象的元素
c++
、
c++11
、
operator-overloading
、
stdvector
、
subscript-operator
::
vector
,因此我重载下标操作符operator[],以直接访问向量的元素。我在代码中这样使用这个类:for (size_t i=0; i<
AVector
.size(); i++)
std
::wcout << L"
Vector
element #" <&
浏览 5
提问于2015-12-01
得票数 2
回答已采纳
2
回答
清除向量或定义新向量,哪个更快?
c++
、
vector
方法1:
std
::
vector
< int >
aVector
;
aVector
.clear(); }方法2: for ( int i = 0; i < 1000000; ++i ) {
std
::
vector
< int >
浏览 1
提问于2013-10-04
得票数 19
回答已采纳
1
回答
在
std
::list和
std
::
vector
之间选择
c++
、
list
、
vector
::
vector
<ulong>
aVector
; entry( ulong a, ulong t ) { time.push_back(t); ulong addr;}; // theVec is the output
vector
void compress(
aVector
&
浏览 0
提问于2013-06-17
得票数 0
回答已采纳
1
回答
我无法
从
文件中读取矢量。表达式:向量下标超出范围
c++
、
vector
、
iterator
、
copy
、
ifstream
我的程序总是停在
std
::copy行中。无论如何,我的编译器不会向我显示任何警告和其他错误。ifstream fin("aFileName", ios_base::in | ios_base::binary);
std
::copy(
std
::istream_iterator<aClass, char>(fin),
std
::istream_iterator&
浏览 4
提问于2014-10-24
得票数 0
回答已采纳
3
回答
向量不push_back整数
c++
、
vector
#include <iostream>#include <
vector
> { int counter = 0;
vector
<int>
aVector
; ...cout &
浏览 8
提问于2015-10-20
得票数 1
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
实时音视频
活动推荐
运营活动
广告
关闭
领券