Comments (4)
There are definitely some issues with the way in which the headers are set up right now, but we do make use of Clang in-house and I haven't seen the issue you have raised. Would it be possible for you to provide an example of your usage that is cause this error to show up?
from future-extensions.
Hmm, here's some pseudocode of essentially how we use it atm:
#include "ExpectedFuture.h"
SD::TExpectedFuture<TCustomHttpResponse<FHttpResponsePtr>> FCustomHttpRequest::Send()
{
TSharedPtr<SD::TExpectedPromise<TCustomHttpResponse<FHttpResponsePtr>>> Promise =
MakeShared<SD::TExpectedPromise<TCustomHttpResponse<FHttpResponsePtr>>>();
FCustomOnRequestSuccess OnSuccess;
OnSuccess.AddLambda([Promise](const FHttpResponsePtr Response)
{
// TCustomHttpResponse can be built from a response or a standard error
Promise->SetValue(Response);
});
FCustomOnRequestError OnError;
OnError.AddLambda([Promise](const FStandardError& Error)
{
// TCustomHttpResponse can be built from a response or a standard error
Promise->SetValue(Error);
});
// Essentially sends an HTTP Request
Send(OnSuccess, OnError);
return Promise->GetFuture();
}
I don't think there's anything particularly fancy. For what it's worth, our changes we've made to the library so far are:
// In FutureExtensionsTypeTraits.h
// Copyright(c) Splash Damage. All rights reserved.
#pragma once
#include "Templates/IntegralConstant.h"
#include "Runtime/Launch/Resources/Version.h"
// <Modification> Included ExpectedResult.h header to avoid implicit template instantiation clang compile error
#include "ExpectedResult.h"
// </Modification>
This seems to resolve the issue.
from future-extensions.
The library currently expects that you bring it in with
#include "FutureExtensions.h"
rather than any of the other headers - this is on my TODO list to investigate properly, but has been low priority.
Doing that should remove the need to modify any of the files.
A small note of the code above too - you don't need to MakeShared
the promise, as it is internally just a wrapper around a shared pointer itself - copying the promise will still refer to the same object, so it will still be safe to capture by value in the lambdas, though you may need to mark them as mutable.
from future-extensions.
Awesome! Thanks for the info. That did indeed fix things. I didn't really check for a wrapper header. My bad! Thanks!
from future-extensions.
Related Issues (8)
- Question/Help: Installation, Usage and Wrapping UE4 delegates HOT 4
- Crash when stopping PIE during execution of continuation HOT 2
- Error when packaging for Linux HOT 1
- Execution policy ThreadPool test failures in UE5 EA HOT 3
- Memory Leak in TExpectedPromiseState HOT 2
- Custom Error Types HOT 4
- Question: Performance with chained promises? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from future-extensions.