如何解决提供默认值作为模板的功能
当我使用@WebMvcTest(Controller.class)
public class ControllerTest {
@MockBean
private ProcessorFactory processorFactory ;
@MockBean
private IProcessor processor;
@Autowired
private MockMvc mockMvc;
@Test
public void test1() throws Exception {
when(processor.process(any(Request.class),any(String.class)))
.thenReturn(new BlaBla("Test","Test"));
String request = ...
this.mockMvc.perform(post("/test/test").contentType(MediaType.APPLICATION_JSON).content(request))
.andDo(print())
.andExpect(status().is2xxSuccessful());
}
}
这样的说法时,它工作正常。但是现在我喜欢使用默认模板值,因此我将其更改为Event<void()>
,以便可以使用template<class _Fty = void()>
。但是它似乎因一系列错误而失败。
Event<> aEvent
任何人都可以建议如何完成如上所述的工作吗?
template<class _Fty>
struct Event final {
typedef std::function<_Fty> listener_type;
...
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。