- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 C++ boost 库 1.6.3 将游戏的主类序列化并保存到文本文件,其中附加了不同的类作为指针和引用、数组和基本类型变量,问题是当我加载文件,它崩溃并给出以下输出:
Assertion failed: register_type(bpis_ptr->get_basic_serializer()) == cid, file libs\serialization\src\basic_iarchive.cpp, line 454
问题是这个类与其他序列化的类相似,并且没有错误。
按照 boost::serialization 指令序列化这就是我正在做的事情:1)在基类中:添加序列化访问的友元类,以及要序列化的函数,例如:
class BJShoe
{
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int file_version)
{
ar & BOOST_SERIALIZATION_NVP(totalCards);
ar & BOOST_SERIALIZATION_NVP(cards);
ar & BOOST_SERIALIZATION_NVP(numCards);
}
protected:
int totalCards[10],
cards[10],
numCards;
}
所以,对于主类,我有这样的东西:
class Game {
int numDecks;
bool hitSoft17;
bool doubleAnyTotal;
bool double9;
bool doubleSoft;
bool doubleAfterHit;
bool doubleAfterSplit;
bool resplit;
bool resplitAces;
bool lateSurrender;
int dealerSpeed;
BJStrategy maxValueStrategy;
Progress progress;
// Release all objects on exit
BJRules *rules;
Player *strategy;
Hand *dealer;
Probabilities *dealerProbabilities;
Shoe *shoe;
BJShoe *distribution;
PlayerHand *tempHand;
//counters and game-loop vars
int lastWager;
int balance;
Card tempCard;
PlayerHand playerHands[4];
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
ar.template register_type<BJShoe*>();
ar.template register_type<PlayerHand*>();
//etc.
ar.template register_type<BJShoe>();
ar.template register_type<PlayerHand>();
cout << "numDecks\n";
ar & BOOST_SERIALIZATION_NVP(numDecks);
cout << "hitSoft17\n";
ar & BOOST_SERIALIZATION_NVP(hitSoft17);
cout << "doubleAnyTotal\n";
ar & BOOST_SERIALIZATION_NVP(doubleAnyTotal);
cout << "double9\n";
ar & BOOST_SERIALIZATION_NVP(double9);
cout << "doubleSoft\n";
ar & BOOST_SERIALIZATION_NVP(doubleSoft);
cout << "doubleAfterHit\n";
ar & BOOST_SERIALIZATION_NVP(doubleAfterHit);
cout << "doubleAfterSplit\n";
ar & BOOST_SERIALIZATION_NVP(doubleAfterSplit);
cout << "resplit\n";
ar & BOOST_SERIALIZATION_NVP(resplit);
cout << "resplitAces\n";
ar & BOOST_SERIALIZATION_NVP(resplitAces);
cout << "lateSurrender\n";
ar & BOOST_SERIALIZATION_NVP(lateSurrender);
cout << "dealerSpeed\n";
ar & BOOST_SERIALIZATION_NVP(dealerSpeed);
cout << "maxValueStrategy\n";
ar & BOOST_SERIALIZATION_NVP(maxValueStrategy);
cout << "progress\n";
ar & BOOST_SERIALIZATION_NVP(progress);
cout << "rules\n";
ar & BOOST_SERIALIZATION_NVP(rules);
cout << "strategy\n";
ar & BOOST_SERIALIZATION_NVP(strategy);
cout << "dealer\n";
ar & BOOST_SERIALIZATION_NVP(dealer);
cout << "dealerProbabilities\n";
ar & BOOST_SERIALIZATION_NVP(dealerProbabilities);
cout << "shoe\n";
ar & BOOST_SERIALIZATION_NVP(shoe);
cout << "distribution\n";
ar & BOOST_SERIALIZATION_NVP(distribution);
cout << "tempHand\n";
ar & BOOST_SERIALIZATION_NVP(tempHand);
cout << "lastWager\n";
ar & BOOST_SERIALIZATION_NVP(lastWager);
cout << "balance\n";
ar & BOOST_SERIALIZATION_NVP(balance);
cout << "tempCard\n";
ar & BOOST_SERIALIZATION_NVP(tempCard);
/*for (int i = 0; i < 4; i++) {
ar & BOOST_SERIALIZATION_NVP(playerHands[i]);
cout << "playerHands["<<i<<"]\n";
}*/
ar & BOOST_SERIALIZATION_NVP(playerHands);
cout << "playerHands\n";
}
}
2)在子类中,同(1)一样,添加base_object函数,以继承BJShoe的Shoe为例:
boost::serialization::base_object<BJShoe>(*this);
3)导出cpp中的类,示例:
BOOST_CLASS_EXPORT(Shoe)
BOOST_CLASS_EXPORT(BJShoe)
4) 保存函数
void Game::save(const char* filename)
{
ofstream ofs(filename);
if (!ofs.good()) return;
text_oarchive oa(ofs);
//register all the classes, example:
oa.register_type<Shoe>();
oa.register_type<BJShoe>();
oa.register_type<Game>();
oa << boost::serialization::make_nvp("game",instance);
ofs.close();
}
5) 加载函数:
void Game::load(const char* filename)
{
ifstream ifs(filename);
if (!ifs.good()) return;
text_iarchive ia(ifs);
//register all the classes, example:
ia.register_type<Shoe>();
ia.register_type<BJShoe>();
ia.register_type<Game>();
ia >> boost::serialization::make_nvp("game",instance);
ifs.close();
}
6) 调用保存("play.data");加载(“播放数据”);导致程序崩溃,这是日志:
./bj play
numDecks
hitSoft17
doubleAnyTotal
double9
doubleSoft
doubleAfterHit
doubleAfterSplit
resplit
resplitAces
lateSurrender
dealerSpeed
maxValueStrategy
progress
rules
strategy
dealer
dealerProbabilities
shoe
distribution
Segmentation fault
[jbelon@localhost cpp]$ gdb ./bj
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /var/www/html/blackjack/cpp/bj...done.
(gdb) run play
Starting program: /var/www/html/blackjack/cpp/./bj play
numDecks
hitSoft17
doubleAnyTotal
double9
doubleSoft
doubleAfterHit
doubleAfterSplit
resplit
resplitAces
lateSurrender
dealerSpeed
maxValueStrategy
progress
rules
strategy
dealer
dealerProbabilities
shoe
distribution
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bad05c in boost::archive::detail::basic_iarchive_impl::load_preamble (this=0x6bd4c0, ar=..., co=...) at libs/serialization/src/basic_iarchive.cpp:319
319 if(co.bis_ptr->class_info()){
(gdb) backtrace
#0 0x00007ffff7bad05c in boost::archive::detail::basic_iarchive_impl::load_preamble (this=0x6bd4c0, ar=..., co=...) at libs/serialization/src/basic_iarchive.cpp:319
#1 0x00007ffff7bae132 in boost::archive::detail::basic_iarchive_impl::load_pointer (this=0x6bd4c0, ar=..., t=@0x6bdcb8: 0x6bd790,
bpis_ptr=0x6b7190 <boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, BJShoe> >::get_instance()::t>, finder=<optimized out>)
at libs/serialization/src/basic_iarchive.cpp:446
#2 0x0000000000457063 in boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::invoke<BJShoe*> (ar=..., t=@0x6bdcb8: 0x6bd790)
at /usr/include/boost/archive/detail/iserializer.hpp:524
#3 0x0000000000456484 in boost::archive::load<boost::archive::text_iarchive, BJShoe*> (ar=..., t=@0x6bdcb8: 0x6bd790) at /usr/include/boost/archive/detail/iserializer.hpp:592
#4 0x000000000045609e in boost::archive::detail::common_iarchive<boost::archive::text_iarchive>::load_override<BJShoe*> (this=0x7fffffffdb80, t=@0x6bdcb8: 0x6bd790)
at /usr/include/boost/archive/detail/common_iarchive.hpp:66
#5 0x0000000000455bab in boost::archive::basic_text_iarchive<boost::archive::text_iarchive>::load_override<BJShoe*> (this=0x7fffffffdb80, t=@0x6bdcb8: 0x6bd790)
at /usr/include/boost/archive/basic_text_iarchive.hpp:65
#6 0x00000000004558ff in boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override<BJShoe*> (this=0x7fffffffdb80, t=@0x6bdcb8: 0x6bd790)
at /usr/include/boost/archive/text_iarchive.hpp:82
#7 0x00000000004555c0 in boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator>><BJShoe*> (this=0x7fffffffdb80, t=@0x6bdcb8: 0x6bd790)
at /usr/include/boost/archive/detail/interface_iarchive.hpp:60
#8 0x0000000000455209 in boost::serialization::nvp<BJShoe*>::load<boost::archive::text_iarchive> (this=0x7fffffffd000, ar=...) at /usr/include/boost/serialization/nvp.hpp:87
#9 0x0000000000454d72 in boost::serialization::access::member_load<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:101
#10 0x0000000000454889 in boost::serialization::detail::member_loader<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> >::invoke (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/split_member.hpp:54
#11 0x0000000000454345 in boost::serialization::split_member<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/split_member.hpp:69
#12 0x0000000000453ce5 in boost::serialization::nvp<BJShoe*>::serialize<boost::archive::text_iarchive> (this=0x7fffffffd000, ar=..., file_version=0)
at /usr/include/boost/serialization/nvp.hpp:89
#13 0x00000000004536c2 in boost::serialization::access::serialize<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:118
#14 0x00000000004530dc in boost::serialization::serialize<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#15 0x0000000000452a49 in boost::serialization::serialize_adl<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#16 0x00000000004522b1 in boost::archive::detail::load_non_pointer_type<boost::archive::text_iarchive>::load_only::invoke<boost::serialization::nvp<BJShoe*> > (ar=..., t=...)
at /usr/include/boost/archive/detail/iserializer.hpp:373
#17 0x0000000000451a32 in boost::archive::detail::load_non_pointer_type<boost::archive::text_iarchive>::invoke<boost::serialization::nvp<BJShoe*> const> (ar=..., t=...)
at /usr/include/boost/archive/detail/iserializer.hpp:439
#18 0x000000000045111f in boost::archive::load<boost::archive::text_iarchive, boost::serialization::nvp<BJShoe*> const> (ar=..., t=...)
at /usr/include/boost/archive/detail/iserializer.hpp:592
#19 0x000000000045099e in boost::archive::detail::common_iarchive<boost::archive::text_iarchive>::load_override<boost::serialization::nvp<BJShoe*> const> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/detail/common_iarchive.hpp:66
#20 0x00000000004503d5 in boost::archive::basic_text_iarchive<boost::archive::text_iarchive>::load_override<boost::serialization::nvp<BJShoe*> const> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/basic_text_iarchive.hpp:65
#21 0x000000000044fdab in boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override<boost::serialization::nvp<BJShoe*> const> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/text_iarchive.hpp:82
#22 0x000000000044f6f0 in boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator>><boost::serialization::nvp<BJShoe*> const> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/detail/interface_iarchive.hpp:60
#23 0x000000000044e2d3 in boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator&<boost::serialization::nvp<BJShoe*> const> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/detail/interface_iarchive.hpp:67
#24 0x000000000044cc31 in Game::serialize<boost::archive::text_iarchive> (this=0x6bdc60, ar=..., version=1) at Game.h:271
#25 0x000000000044aeee in boost::serialization::access::serialize<boost::archive::text_iarchive, Game> (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/access.hpp:118
#26 0x0000000000449f6b in boost::serialization::serialize<boost::archive::text_iarchive, Game> (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/serialization.hpp:69
#27 0x0000000000447364 in boost::serialization::serialize_adl<boost::archive::text_iarchive, Game> (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/serialization.hpp:128
#28 0x0000000000444677 in boost::archive::detail::iserializer<boost::archive::text_iarchive, Game>::load_object_data (
this=0x6b8090 <boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::text_iarchive, Game> >::get_instance()::t>, ar=..., x=0x6bdc60, file_version=1)
at /usr/include/boost/archive/detail/iserializer.hpp:188
#29 0x00007ffff7bad852 in load_object (bis=..., t=0x6bdc60, ar=..., this=0x6bd4c0) at libs/serialization/src/basic_iarchive.cpp:362
#30 boost::archive::detail::basic_iarchive::load_object (this=0x7fffffffdb80, t=<optimized out>, bis=...) at libs/serialization/src/basic_iarchive.cpp:537
#31 0x0000000000454e03 in boost::archive::detail::load_non_pointer_type<boost::archive::text_iarchive>::load_standard::invoke<Game> (ar=..., t=...)
at /usr/include/boost/archive/detail/iserializer.hpp:387
#32 0x0000000000454914 in boost::archive::detail::load_non_pointer_type<boost::archive::text_iarchive>::invoke<Game> (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:439
#33 0x00000000004543c5 in boost::archive::load<boost::archive::text_iarchive, Game> (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:592
#34 0x0000000000453d6e in boost::archive::detail::common_iarchive<boost::archive::text_iarchive>::load_override<Game> (this=0x7fffffffdb80, t=...)
at /usr/include/boost/archive/detail/common_iarchive.hpp:66
#35 0x0000000000453745 in boost::archive::basic_text_iarchive<boost::archive::text_iarchive>::load_override<Game> (this=0x7fffffffdb80, t=...)
我不明白这是否与构造函数或序列化函数有关,因为看起来它正在尝试使用 null 进行初始化,对吧?
最佳答案
我不得不重新编写游戏代码并且添加了所有的复制构造函数;现在它运行正常,正在加载和保存数据。问题在于信息的顺序和构造函数的使用。但是,有时它会因 PlayerHand 指针而崩溃,我必须检查一下。现在的另一个问题是它只适用于 Windows,在 GNU/Linux 中保存数据时,这是新的段错误崩溃日志:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004215f6 in boost::archive::basic_text_oprimitive<std::ostream>::save<int > (this=0x7fffffffdeb8, t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/basic_text_oprimitive.hpp:92
92 os << t;
(gdb) reverse-step
Target child does not support this command.
(gdb) reverse-continue
Target child does not support this command.
(gdb) backtrace
#0 0x00000000004215f6 in boost::archive::basic_text_oprimitive<std::ostream>::save <int> (this=0x7fffffffdeb8, t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/basic_text_oprimitive.hpp:92
#1 0x000000000041e9c5 in boost::archive::text_oarchive_impl<boost::archive::text_o archive>::save<int> (this=0x7fffffffdea0, t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/text_oarchive.hpp:61
#2 0x000000000041cf10 in boost::archive::save_access::save_primitive<boost::archiv e::text_oarchive, int> (ar=..., t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/oserializer.hpp:88
#3 0x000000000041a989 in boost::archive::detail::save_non_pointer_type<boost::arch ive::text_oarchive>::save_primitive::invoke<int> (ar=...,
t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/oserializer.hpp:232
#4 0x000000000041876c in boost::archive::detail::save_non_pointer_type<boost::arch ive::text_oarchive>::invoke<int> (ar=..., t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#5 0x00000000004265ca in boost::archive::save<boost::archive::text_oarchive, int c onst> (ar=..., t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#6 0x0000000000425fa8 in boost::archive::detail::common_oarchive<boost::archive::t ext_oarchive>::save_override<int const> (this=0x7fffffffdea0,
t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#7 0x0000000000425991 in boost::archive::basic_text_oarchive<boost::archive::text_ oarchive>::save_override<int const> (this=0x7fffffffdea0,
t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#8 0x00000000004251da in boost::archive::detail::interface_oarchive<boost::archive ::text_oarchive>::operator<< <int const> (this=0x7fffffffdea0,
t=@0xffffe3d0: <error reading variable>)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#9 0x0000000000430ecf in boost::serialization::nvp<int const>::save<boost::archive ::text_oarchive> (this=0x7fffffffc400, ar=...)
at /usr/include/boost/serialization/nvp.hpp:79
#10 0x0000000000430a3f in boost::serialization::access::member_save<boost::archive: :text_oarchive, boost::serialization::nvp<int const> const> (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/access.hpp:93
#11 0x000000000043070c in boost::serialization::detail::member_saver<boost::archive ::text_oarchive, boost::serialization::nvp<int const> >::invoke (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/split_member.hpp:43
#12 0x00000000004303ac in boost::serialization::split_member<boost::archive::text_o archive, boost::serialization::nvp<int const> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/split_member.hpp:69
#13 0x000000000042feef in boost::serialization::nvp<int const>::serialize<boost::ar chive::text_oarchive> (this=0x7fffffffc400, ar=..., file_version=0)
at /usr/include/boost/serialization/nvp.hpp:89
#14 0x000000000042fb93 in boost::serialization::access::serialize<boost::archive::t ext_oarchive, boost::serialization::nvp<int const> > (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/access.hpp:118
#15 0x000000000042f87d in boost::serialization::serialize<boost::archive::text_oarc hive, boost::serialization::nvp<int const> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#16 0x000000000042f610 in boost::serialization::serialize_adl<boost::archive::text_ oarchive, boost::serialization::nvp<int const> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#17 0x000000000042f3cb in boost::archive::detail::save_non_pointer_type<boost::arch ive::text_oarchive>::save_only::invoke<boost::serialization::nvp<int const> > (
ar=..., t=...) at /usr/include/boost/archive/detail/oserializer.hpp:241
#18 0x000000000042f1a2 in boost::archive::detail::save_non_pointer_type<boost::arch ive::text_oarchive>::invoke<boost::serialization::nvp<int const> > (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#19 0x000000000042ee56 in boost::archive::save<boost::archive::text_oarchive, boost ::serialization::nvp<int const> const> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#20 0x000000000042ebbc in boost::archive::detail::common_oarchive<boost::archive::t ext_oarchive>::save_override<boost::serialization::nvp<int const> const> (
---Type <return> to continue, or q <return> to quit---
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#21 0x000000000042e943 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<boost::serialization::nvp<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#22 0x000000000042e59a in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <boost::serialization::nvp<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#23 0x000000000042e13f in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator&<boost::serialization::nvp<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:71
#24 0x000000000042d9d4 in boost::serialization::array<int const>::serialize_optimized<boost::archive::text_oarchive> (this=0x7fffffffc620, ar=...)
at /usr/include/boost/serialization/array.hpp:72
#25 0x000000000042d1a9 in boost::serialization::array<int const>::serialize<boost::archive::text_oarchive> (this=0x7fffffffc620, ar=..., version=0)
at /usr/include/boost/serialization/array.hpp:104
#26 0x000000000042c8f2 in boost::serialization::access::serialize<boost::archive::text_oarchive, boost::serialization::array<int const> > (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/access.hpp:118
#27 0x000000000042c346 in boost::serialization::serialize<boost::archive::text_oarchive, boost::serialization::array<int const> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#28 0x000000000042be09 in boost::serialization::serialize_adl<boost::archive::text_oarchive, boost::serialization::array<int const> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#29 0x000000000042b861 in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_only::invoke<boost::serialization::array<int const> > (
ar=..., t=...) at /usr/include/boost/archive/detail/oserializer.hpp:241
#30 0x000000000042b46e in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::invoke<boost::serialization::array<int const> > (ar=...,
t=...) at /usr/include/boost/archive/detail/oserializer.hpp:308
#31 0x000000000042a840 in boost::archive::save<boost::archive::text_oarchive, boost::serialization::array<int const> const> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#32 0x000000000042a02e in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<boost::serialization::array<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#33 0x000000000042970d in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<boost::serialization::array<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#34 0x0000000000428a92 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <boost::serialization::array<int const> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#35 0x0000000000428071 in boost::archive::detail::save_array_type<boost::archive::text_oarchive>::invoke<int [11]> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:503
#36 0x00000000004278c1 in boost::archive::save<boost::archive::text_oarchive, int const [11]> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#37 0x000000000042729c in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<int const [11]> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#38 0x0000000000426d11 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<int const [11]> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#39 0x00000000004266aa in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <int const [11]> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#40 0x0000000000426081 in boost::archive::detail::interface_oarchive<boost::archive---Type <return> to continue, or q <return> to quit---
::text_oarchive>::operator&<int [11]> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:71
#41 0x000000000042a15a in BJHand::serialize<boost::archive::text_oarchive> (
this=0xffffe3d0, ar=..., version=0) at src/blackjack.h:31
#42 0x00000000004297b9 in boost::serialization::access::serialize<boost::archive::text_oarchive, BJHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:118
#43 0x0000000000428c2f in boost::serialization::serialize<boost::archive::text_oarchive, BJHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#44 0x0000000000428229 in boost::serialization::serialize_adl<boost::archive::text_oarchive, BJHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#45 0x00000000004279da in boost::archive::detail::oserializer<boost::archive::text_oarchive, BJHand>::save_object_data (
this=0x6f9670 <boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::text_oarchive, BJHand> >::get_instance()::t>, ar=...,
x=0xffffe3d0) at /usr/include/boost/archive/detail/oserializer.hpp:148
#46 0x00007ffff7bae94d in save_object (bos=..., t=0xffffe3d0, ar=...,
this=0x6fe570) at libs/serialization/src/basic_oarchive.cpp:292
#47 boost::archive::detail::basic_oarchive::save_object (this=0x7fffffffdea0,
x=0xffffe3d0, bos=...) at libs/serialization/src/basic_oarchive.cpp:423
#48 0x0000000000427359 in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_standard::invoke<BJHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:253
#49 0x0000000000426dbd in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::invoke<BJHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#50 0x000000000042675c in boost::archive::save<boost::archive::text_oarchive, BJHand const> (ar=..., t=...) at /usr/include/boost/archive/detail/oserializer.hpp:525
#51 0x0000000000426134 in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<BJHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#52 0x0000000000425b1b in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<BJHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#53 0x0000000000425338 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <BJHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#54 0x0000000000424b81 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator&<BJHand> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:71
#55 0x00000000004240d9 in Hand::serialize<boost::archive::text_oarchive> (
this=0xffffe3d0, ar=..., version=0) at src/game.cpp:300
#56 0x0000000000423723 in boost::serialization::access::serialize<boost::archive::text_oarchive, Hand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:118
#57 0x0000000000422047 in boost::serialization::serialize<boost::archive::text_oarchive, Hand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#58 0x000000000041f19f in boost::serialization::serialize_adl<boost::archive::text_oarchive, Hand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#59 0x000000000041d478 in boost::archive::detail::oserializer<boost::archive::text_oarchive, Hand>::save_object_data (
this=0x6f9580 <boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::text_oarchive, Hand> >::get_instance()::t>, ar=...,
x=0xffffe3d0) at /usr/include/boost/archive/detail/oserializer.hpp:148
#60 0x00007ffff7bae94d in save_object (bos=..., t=0xffffe3d0, ar=...,
this=0x6fe570) at libs/serialization/src/basic_oarchive.cpp:292
#61 boost::archive::detail::basic_oarchive::save_object (this=0x7fffffffdea0,
x=0xffffe3d0, bos=...) at libs/serialization/src/basic_oarchive.cpp:423
#62 0x0000000000427487 in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_standard::invoke<Hand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:253
#63 0x0000000000426ebb in boost::archive::detail::save_non_pointer_type<boost::arch---Type <return> to continue, or q <return> to quit---
ive::text_oarchive>::invoke<Hand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#64 0x000000000042685c in boost::archive::save<boost::archive::text_oarchive, Hand const> (ar=..., t=...) at /usr/include/boost/archive/detail/oserializer.hpp:525
#65 0x0000000000426248 in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<Hand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#66 0x0000000000425c35 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<Hand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#67 0x00000000004254a0 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <Hand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#68 0x0000000000424cc9 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator&<Hand> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:71
#69 0x00000000004241eb in PlayerHand::serialize<boost::archive::text_oarchive> (
this=0xffffe3d0, ar=..., version=0) at src/game.cpp:362
#70 0x00000000004237f2 in boost::serialization::access::serialize<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:118
#71 0x00000000004224bb in boost::serialization::serialize<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#72 0x000000000041f533 in boost::serialization::serialize_adl<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#73 0x000000000041d634 in boost::archive::detail::oserializer<boost::archive::text_oarchive, PlayerHand>::save_object_data (
this=0x6f9550 <boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::text_oarchive, PlayerHand> >::get_instance()::t>, ar=...,
x=0xffffe3d0) at /usr/include/boost/archive/detail/oserializer.hpp:148
#74 0x00007ffff7bae94d in save_object (bos=..., t=0xffffe3d0, ar=...,
this=0x6fe570) at libs/serialization/src/basic_oarchive.cpp:292
#75 boost::archive::detail::basic_oarchive::save_object (this=0x7fffffffdea0,
x=0xffffe3d0, bos=...) at libs/serialization/src/basic_oarchive.cpp:423
#76 0x000000000042ad0f in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_standard::invoke<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:253
#77 0x000000000042a33c in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::invoke<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#78 0x0000000000429a70 in boost::archive::save<boost::archive::text_oarchive, PlayerHand const> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#79 0x0000000000428fc6 in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<PlayerHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#80 0x0000000000428491 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<PlayerHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#81 0x0000000000427bb8 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <PlayerHand const> (this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#82 0x0000000000427507 in boost::serialization::nvp<PlayerHand>::save<boost::archive::text_oarchive> (this=0x7fffffffd330, ar=...)
at /usr/include/boost/serialization/nvp.hpp:79
#83 0x0000000000426f4f in boost::serialization::access::member_save<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> const> (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/access.hpp:93
#84 0x00000000004268af in boost::serialization::detail::member_saver<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> >::invoke (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/split_member.hpp:43
#85 0x00000000004262a3 in boost::serialization::split_member<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/split_member.hpp:69
---Type <return> to continue, or q <return> to quit---
#86 0x0000000000425c8f in boost::serialization::nvp<PlayerHand>::serialize<boost::archive::text_oarchive> (this=0x7fffffffd330, ar=..., file_version=0)
at /usr/include/boost/serialization/nvp.hpp:89
#87 0x0000000000425515 in boost::serialization::access::serialize<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> > (ar=..., t=...,
file_version=0) at /usr/include/boost/serialization/access.hpp:118
#88 0x0000000000424d22 in boost::serialization::serialize<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#89 0x0000000000424260 in boost::serialization::serialize_adl<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> > (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#90 0x0000000000423822 in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_only::invoke<boost::serialization::nvp<PlayerHand> > (
ar=..., t=...) at /usr/include/boost/archive/detail/oserializer.hpp:241
#91 0x00000000004224e5 in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::invoke<boost::serialization::nvp<PlayerHand> > (ar=...,
t=...) at /usr/include/boost/archive/detail/oserializer.hpp:308
#92 0x000000000041f558 in boost::archive::save<boost::archive::text_oarchive, boost::serialization::nvp<PlayerHand> const> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#93 0x000000000041d66a in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<boost::serialization::nvp<PlayerHand> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#94 0x000000000041b8e1 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<boost::serialization::nvp<PlayerHand> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#95 0x0000000000419380 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <boost::serialization::nvp<PlayerHand> const> (
this=0x7fffffffdea0, t=...)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#96 0x0000000000416d19 in boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, PlayerHand>::save_object_ptr (
this=0x6f9650 <boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, PlayerHand> >::get_instance()::t>,
ar=..., x=0xffffe3d0) at /usr/include/boost/archive/detail/oserializer.hpp:201
#97 0x00007ffff7baed85 in save_pointer (
bpos_ptr=0x6f9650 <boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, PlayerHand> >::get_instance()::t>,
t=<optimized out>, ar=..., this=0x6fe570)
at libs/serialization/src/basic_oarchive.cpp:391
#98 boost::archive::detail::basic_oarchive::save_pointer (this=0x7fffffffdea0,
t=0xffffe3d0,
bpos_ptr=0x6f9650 <boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, PlayerHand> >::get_instance()::t>)
at libs/serialization/src/basic_oarchive.cpp:431
#99 0x0000000000427b73 in boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::non_polymorphic::save<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:365
#100 0x00000000004274d4 in boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::save<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:460
#101 0x0000000000426f24 in boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::invoke<PlayerHand*> (ar=..., t=0xffffe3d0)
at /usr/include/boost/archive/detail/oserializer.hpp:473
#102 0x0000000000426884 in boost::archive::save<boost::archive::text_oarchive, PlayerHand* const> (ar=..., t=@0x7fffffffe3b0: 0xffffe3d0)
at /usr/include/boost/archive/detail/oserializer.hpp:525
#103 0x0000000000426278 in boost::archive::detail::common_oarchive<boost::archive::text_oarchive>::save_override<PlayerHand* const> (this=0x7fffffffdea0,
t=@0x7fffffffe3b0: 0xffffe3d0)
at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#104 0x0000000000425c63 in boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::save_override<PlayerHand* const> (this=0x7fffffffdea0,
---Type <return> to continue, or q <return> to quit---
t=@0x7fffffffe3b0: 0xffffe3d0)
at /usr/include/boost/archive/basic_text_oarchive.hpp:80
#105 0x00000000004254de in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator<< <PlayerHand* const> (this=0x7fffffffdea0,
t=@0x7fffffffe3b0: 0xffffe3d0)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#106 0x0000000000424cf7 in boost::archive::detail::interface_oarchive<boost::archive::text_oarchive>::operator&<PlayerHand*> (this=0x7fffffffdea0,
t=@0x7fffffffe3b0: 0xffffe3d0)
at /usr/include/boost/archive/detail/interface_oarchive.hpp:71
#107 0x0000000000424219 in PlayerHand::serialize<boost::archive::text_oarchive> (
this=0x7fffffffe358, ar=..., version=0) at src/game.cpp:364
#108 0x00000000004237f2 in boost::serialization::access::serialize<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/access.hpp:118
#109 0x00000000004224bb in boost::serialization::serialize<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:69
#110 0x000000000041f533 in boost::serialization::serialize_adl<boost::archive::text_oarchive, PlayerHand> (ar=..., t=..., file_version=0)
at /usr/include/boost/serialization/serialization.hpp:128
#111 0x000000000041d634 in boost::archive::detail::oserializer<boost::archive::text_oarchive, PlayerHand>::save_object_data (
this=0x6f9550 <boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::text_oarchive, PlayerHand> >::get_instance()::t>, ar=...,
x=0x7fffffffe358) at /usr/include/boost/archive/detail/oserializer.hpp:148
#112 0x00007ffff7bae94d in save_object (bos=..., t=0x7fffffffe358, ar=...,
this=0x6fe570) at libs/serialization/src/basic_oarchive.cpp:292
#113 boost::archive::detail::basic_oarchive::save_object (this=0x7fffffffdea0,
x=0x7fffffffe358, bos=...) at libs/serialization/src/basic_oarchive.cpp:423
#114 0x000000000042ad0f in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::save_standard::invoke<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:253
#115 0x000000000042a33c in boost::archive::detail::save_non_pointer_type<boost::archive::text_oarchive>::invoke<PlayerHand> (ar=..., t=...)
at /usr/include/boost/archive/detail/oserializer.hpp:308
#116 0x0000000000429a70 in boost::archive::save<boost::archive::text_oarchive, PlayerHand const> (ar=..., t=...)
关于c++ - 崩溃 : Segmentation fault: Boost serialization loading - calling constructor with null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42268880/
我正在 div 中加载一个 php 页面,该页面采用发布的变量来显示正确的内容。它的工作原理是这样的: $(".mainArea").load("page.php", {'folder': 'a'})
我是 AWS 新手。我开始学习 ALB 和 NLB。我知道 ALB 在第 7 层协议(protocol)中工作,而 NLB 在第 4 层协议(protocol)中工作。 谁能解释一下ALB和NLB的实
这是来自 this Article . filter(loaded => !loaded) 有什么作用?我没有在任何地方看到该变量的定义。 我明白这个方法的目的是什么,只是不是那一行。 canActi
我应该在 Constructor 还是 FormLoad() 中加载子表单? 我有一些代码调用在控件中嵌入表单的自定义类。我最初是在 Constructor 之外声明我的子窗体,然后在 FormLoa
目录 1、图解 2、json.loads()用法 3、json.load()用法 4、此外还有一种json.dumps 语法
我正在使用 PhoneGap 为 iPad 编写应用程序,我想在不触发 Safari 或使用 ChildBrowser 等内部 Web 浏览器的情况下加载外部 URL。 我正在使用 PhoneGap
人们经常在他们的(与优化和性能相关的)问题和答案中谈论“重载”。 我试图在典型服务器上的常规 Web 应用程序的上下文中量化这一点(以 SO 及其相当小的基础设施为例),假设它们立即返回(以简化和提高
有人可以写这段代码吗: this.Loaded += (s, e) => this.loaded = true; 分成几行代码以便我可以追溯其含义? 在我的代码示例中没有 s 或 e 吗? 最佳答案
我正在使用 jQuery 的 .load()方法和Loading Page Fragments 。以下是我当前的代码: $("#submit").click(function() { $("#
我想实现的是,当单击图像时,在该图像所在的 div 中,加载了一个包含来自另一个 .html 的其他内容的 div,但我无法完成。 如果我这样做,下面的代码将完美运行: $('#windows_lin
我使用 qt 开发了一个 c++ 库。在本文中,我使用 QSqlDatabase 从 SQLite 数据库中查询信息。注意:我的库在 qt 桌面应用程序中运行良好(我在 Linux 上开发)。 现在我
演示:http://jsfiddle.net/FyrRm/1/ 当我们向下滚动时,您会注意到...在滚动到文章标题到 之后我正在展示一个共享小部件。我正在使用 $(window).on("load"
我在 html(PC) 中使用的图像正确加载,我使用了 img 标签。我已将此文件连同图像一起保存并发送到我的手机,但它不会加载到手机上。我对图像大小或任何东西没有任何问题。我认为它与图像位置有关。
我将 .load() 广泛用于 AJAX 内容。很棒,但如果它做得更多一点,我会喜欢它: 如果为了响应用户操作,我多次调用同一个 div 上的 .load(),我可能会在 div 中得到错误的数据。当
我知道很多方法需要调用它的父类(super class)方法,有些方法不需要, 我正在寻找关于方法调配的东西。它在加载方法中初始化,并且在教程中没有[super load]。 我想知道是不是错了,还是
几个月来,我一直在使用pyGame 2.0.1。今天,我升级到最新版本(2.1.2)后,在尝试加载音频文件时开始出现以下错误:。到目前为止我尝试过的东西:。我使用的是Windows 10、Python
我有一个完整的 angular 应用程序,它使用预先加载。 我想将其转换为延迟加载,但是因为我对所有路线都有保护,而且所有路线都是到一条 protected 主路线的子路线,我不知道是否可以做到这一点
我有一个 React 应用程序,它在 useEffect 中调用我的 API,返回一个用作 imy 图像 src 的 URL 列表。 我正在使用 react-loader-spinner 在加载图像时
我正在使用 Slick.js 逐步加载我的图像我注意到有些图像要么部分加载,要么根本没有加载。 例如,在this site上,有两个画廊:建筑和设计(在导航中)。当用户单击任一图像时,他们会看到该图库
我在我的一个项目中收到此警告。这在调用我的后端 api 时会导致问题,因为它调用了 api 两次。我已经尝试过之前在论坛上发布的关于相同查询的解决方案,但我无法解决这个问题。如果有人能帮助我解决这个问
我是一名优秀的程序员,十分优秀!